summaryrefslogtreecommitdiff
path: root/src/register.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-07 17:47:22 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-07 17:47:22 +0100
commit6b649ac4fd0cbf88c5a05d82ad151d0ce980916a (patch)
tree3e59a10e5b1b750270254df7b484d8956b75b766 /src/register.c
parent1f9a028def327bd9bbfef375cb1283cd51e04678 (diff)
downloadvim-git-6b649ac4fd0cbf88c5a05d82ad151d0ce980916a.tar.gz
patch 8.1.2406: leaking memory in test_paste and test_registersv8.1.2406
Problem: Leaking memory in test_paste and test_registers. Solution: Free the old title. Don't copy expr_line.
Diffstat (limited to 'src/register.c')
-rw-r--r--src/register.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/register.c b/src/register.c
index a948bebda..24e4b992a 100644
--- a/src/register.c
+++ b/src/register.c
@@ -2872,9 +2872,9 @@ write_reg_contents_ex(
p = vim_strnsave(str, (int)len);
if (p == NULL)
return;
- if (must_append)
+ if (must_append && expr_line != NULL)
{
- s = concat_str(get_expr_line_src(), p);
+ s = concat_str(expr_line, p);
vim_free(p);
p = s;
}