From 19785a01988c501760f7abc6b5da7010aa9cefc4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 27 Sep 2015 22:23:48 +0300 Subject: ex_getln: Fix memory leak when overwriting history item --- src/nvim/ex_getln.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 7998d7e823..24e31b1ed7 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4298,6 +4298,7 @@ in_history ( } while (i != hisidx[type]); if (last_i >= 0) { + list_T *const list = history[type][i].additional_elements; str = history[type][i].hisstr; while (i != hisidx[type]) { if (++i >= hislen) @@ -4305,6 +4306,7 @@ in_history ( history[type][last_i] = history[type][i]; last_i = i; } + list_unref(list); history[type][i].hisnum = ++hisnum[type]; history[type][i].hisstr = str; history[type][i].timestamp = os_time(); -- cgit