Skip to content

Commit a988496

Browse files
committed
patch 7.4.972
Problem: Memory leak when there is an error in setting an option. Solution: Free the saved value (Christian Brabandt)
1 parent 099fdde commit a988496

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/option.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4970,7 +4970,12 @@ do_set(arg, opt_flags)
49704970

49714971
/* If error detected, print the error message. */
49724972
if (errmsg != NULL)
4973+
{
4974+
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
4975+
vim_free(saved_origval);
4976+
#endif
49734977
goto skip;
4978+
}
49744979
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
49754980
if (saved_origval != NULL)
49764981
{

src/version.c

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

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
972,
744746
/**/
745747
971,
746748
/**/

0 commit comments

Comments
 (0)