]> granicus.if.org Git - vim/commitdiff
patch 8.0.1396: memory leak when CTRL-G in search command line fails v8.0.1396
authorBram Moolenaar <Bram@vim.org>
Sat, 16 Dec 2017 18:05:22 +0000 (19:05 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 16 Dec 2017 18:05:22 +0000 (19:05 +0100)
Problem:    Memory leak when CTRL-G in search command line fails.
Solution:   Move restore_last_search_pattern to after "if".

src/ex_getln.c
src/version.c

index 7c553e42e24cc264a71b34ed46156dd62d7b27e9..405e1f655c0c4ee42d5f236c23148c4edc9deabc 100644 (file)
@@ -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;
index 0b1733827fafffcec68abd174f2c3d66a817b123..224118a11dc34bcca325781f8e5609e4108ca2db 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1396,
 /**/
     1395,
 /**/