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.
diff --git a/src/register.c b/src/register.c
index a948beb..24e4b99 100644
--- a/src/register.c
+++ b/src/register.c
@@ -2872,9 +2872,9 @@
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;
}