Skip to content

Commit a1d5c15

Browse files
committed
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".
1 parent 200d0e3 commit a1d5c15

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/ex_getln.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,11 +1810,11 @@ getcmdline(
18101810
# endif
18111811
old_botline = curwin->w_botline;
18121812
update_screen(NOT_VALID);
1813-
restore_last_search_pattern();
18141813
redrawcmdline();
18151814
}
18161815
else
18171816
vim_beep(BO_ERROR);
1817+
restore_last_search_pattern();
18181818
goto cmdline_not_changed;
18191819
}
18201820
break;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1396,
774776
/**/
775777
1395,
776778
/**/

0 commit comments

Comments
 (0)