changeset 13041:5f3aff09d8f8 v8.0.1396

patch 8.0.1396: memory leak when CTRL-G in search command line fails commit https://github.com/vim/vim/commit/a1d5c154dbd5fbe317726bbf2ba99632b91878f4 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 16 19:05:22 2017 +0100 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".
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Dec 2017 19:15:05 +0100
parents 2d319c0ac54b
children 650b01f57a9c
files src/ex_getln.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1810,11 +1810,11 @@ getcmdline(
 # endif
 			old_botline = curwin->w_botline;
 			update_screen(NOT_VALID);
-			restore_last_search_pattern();
 			redrawcmdline();
 		    }
 		    else
 			vim_beep(BO_ERROR);
+		    restore_last_search_pattern();
 		    goto cmdline_not_changed;
 		}
 		break;
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1396,
+/**/
     1395,
 /**/
     1394,