]> granicus.if.org Git - vim/commitdiff
patch 7.4.972 v7.4.972
authorBram Moolenaar <Bram@vim.org>
Sun, 13 Dec 2015 14:08:56 +0000 (15:08 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 Dec 2015 14:08:56 +0000 (15:08 +0100)
Problem:    Memory leak when there is an error in setting an option.
Solution:   Free the saved value (Christian Brabandt)

src/option.c
src/version.c

index 3f98f47b85356390b40e0d5bb7684cf903bed1a8..0c38de68961a9bab6d500c87914930da9c8bcca9 100644 (file)
@@ -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)
                        {
index 14365945de82b3de9612092a2bacde0bb61c22f1..8a4eddaab1574fcd15ca969b55b91ba49650a678 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    972,
 /**/
     971,
 /**/