From cd59577d576d71aa788a873ce779ce6dc3e7bc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Sun, 21 Jan 2018 14:46:54 +0300 Subject: [PATCH] vim-patch:8.0.1396: memory leak when CTRL-G in search command line fails Problem: Memory leak when CTRL-G in search command line fails. Solution: Move restore_last_search_pattern to after "if". https://github.com/vim/vim/commit/a1d5c154dbd5fbe317726bbf2ba99632b91878f4 --- src/nvim/ex_getln.c | 2 +- src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 692a8893ae..e396a179a1 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1076,11 +1076,11 @@ static void command_line_next_incsearch(CommandLineState *s, bool next_match) s->old_topfill = curwin->w_topfill; s->old_botline = curwin->w_botline; update_screen(NOT_VALID); - restore_last_search_pattern(); redrawcmdline(); } else { vim_beep(BO_ERROR); } + restore_last_search_pattern(); return; } diff --git a/src/nvim/version.c b/src/nvim/version.c index b6a7150f73..370c8ab5d3 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -101,7 +101,7 @@ static const int included_patches[] = { // 1399, // 1398, // 1397, - // 1396, + 1396, // 1395, // 1394, // 1393,