diff options
author | watiko <service@mail.watiko.net> | 2015-12-12 05:28:27 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2015-12-12 05:28:27 +0900 |
commit | 74341ca5cacfcd254aee49fa2ed130ed7ffb5071 (patch) | |
tree | 303343ead507062030b2c44901bf5bf6a6983bc5 /src | |
parent | 8c684b2fdb58487a40968a2fee996bb70e911d56 (diff) | |
download | rneovim-74341ca5cacfcd254aee49fa2ed130ed7ffb5071.tar.gz rneovim-74341ca5cacfcd254aee49fa2ed130ed7ffb5071.tar.bz2 rneovim-74341ca5cacfcd254aee49fa2ed130ed7ffb5071.zip |
Fix the memory leaking
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 7 |
1 files changed, 5 insertions, 2 deletions
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", |