diff options
author | ZyX <kp-pav@yandex.ru> | 2015-09-27 22:23:48 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-10-08 22:01:12 +0300 |
commit | 19785a01988c501760f7abc6b5da7010aa9cefc4 (patch) | |
tree | 92f8125208e237089b40263ddefd05c727b6b333 | |
parent | 1162962d8beaab6be78a32954600205686f5d09b (diff) | |
download | rneovim-19785a01988c501760f7abc6b5da7010aa9cefc4.tar.gz rneovim-19785a01988c501760f7abc6b5da7010aa9cefc4.tar.bz2 rneovim-19785a01988c501760f7abc6b5da7010aa9cefc4.zip |
ex_getln: Fix memory leak when overwriting history item
-rw-r--r-- | src/nvim/ex_getln.c | 2 |
1 files changed, 2 insertions, 0 deletions
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(); |