From a98849670674264de699d7ab22ae4b9b32e78f4a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 13 Dec 2015 15:08:56 +0100 Subject: patch 7.4.972 Problem: Memory leak when there is an error in setting an option. Solution: Free the saved value (Christian Brabandt) --- src/option.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/option.c') 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) { -- cgit v1.2.1