# HG changeset patch # User Christian Brabandt # Date 1450016104 -3600 # Node ID 6890f5a58109486c67cd9cff3d569aa634cfe5e5 # Parent 4219bca38d9c4541a5df4988bef7e0f6caffdb1b commit https://github.com/vim/vim/commit/a98849670674264de699d7ab22ae4b9b32e78f4a Author: Bram Moolenaar Date: Sun Dec 13 15:08:56 2015 +0100 patch 7.4.972 Problem: Memory leak when there is an error in setting an option. Solution: Free the saved value (Christian Brabandt) diff --git a/src/option.c b/src/option.c --- 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 --- 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,