summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-12-13 15:08:56 +0100
committerBram Moolenaar <Bram@vim.org>2015-12-13 15:08:56 +0100
commita98849670674264de699d7ab22ae4b9b32e78f4a (patch)
tree99ac0a3b5a592f81d937282e960890f00e4b7b89 /src
parent099fdde0f073315b7f2700786ae533d23a556348 (diff)
downloadvim-a98849670674264de699d7ab22ae4b9b32e78f4a.zip
patch 7.4.972
Problem: Memory leak when there is an error in setting an option. Solution: Free the saved value (Christian Brabandt)
Diffstat (limited to 'src')
-rw-r--r--src/option.c5
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index 3f98f47b8..0c38de689 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4970,7 +4970,12 @@ do_set(arg, opt_flags)
/* If error detected, print the error message. */
if (errmsg != NULL)
+ {
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ vim_free(saved_origval);
+#endif
goto skip;
+ }
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (saved_origval != NULL)
{
diff --git a/src/version.c b/src/version.c
index 14365945d..8a4eddaab 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 972,
+/**/
971,
/**/
970,