From 74341ca5cacfcd254aee49fa2ed130ed7ffb5071 Mon Sep 17 00:00:00 2001 From: watiko Date: Sat, 12 Dec 2015 05:28:27 +0900 Subject: Fix the memory leaking --- src/nvim/option.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/option.c b/src/nvim/option.c index 1db8831941..ff140bd221 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1792,9 +1792,12 @@ do_set ( errmsg = did_set_string_option(opt_idx, (char_u **)varp, new_value_alloced, oldval, errbuf, opt_flags); - /* If error detected, print the error message. */ - if (errmsg != NULL) + // If error detected, print the error message. + if (errmsg != NULL) { + xfree(saved_origval); goto skip; + } + if (saved_origval != NULL) { char_u buf_type[7]; vim_snprintf((char *)buf_type, ARRAY_SIZE(buf_type), "%s", -- cgit