comparison src/register.c @ 18838:8dabdfc7c799 v8.1.2406

patch 8.1.2406: leaking memory in test_paste and test_registers Commit: https://github.com/vim/vim/commit/6b649ac4fd0cbf88c5a05d82ad151d0ce980916a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 7 17:47:22 2019 +0100 patch 8.1.2406: leaking memory in test_paste and test_registers Problem: Leaking memory in test_paste and test_registers. Solution: Free the old title. Don't copy expr_line.
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Dec 2019 18:00:03 +0100
parents 50fde4e20790
children 2ef19eed524a
comparison
equal deleted inserted replaced
18837:00e789ecc516 18838:8dabdfc7c799
2870 char_u *p, *s; 2870 char_u *p, *s;
2871 2871
2872 p = vim_strnsave(str, (int)len); 2872 p = vim_strnsave(str, (int)len);
2873 if (p == NULL) 2873 if (p == NULL)
2874 return; 2874 return;
2875 if (must_append) 2875 if (must_append && expr_line != NULL)
2876 { 2876 {
2877 s = concat_str(get_expr_line_src(), p); 2877 s = concat_str(expr_line, p);
2878 vim_free(p); 2878 vim_free(p);
2879 p = s; 2879 p = s;
2880 } 2880 }
2881 set_expr_line(p); 2881 set_expr_line(p);
2882 return; 2882 return;