Fix the memory leaking

This commit is contained in:
watiko
2015-12-12 05:28:27 +09:00
parent 8c684b2fdb
commit 74341ca5ca

View File

@@ -1792,9 +1792,12 @@ do_set (
errmsg = did_set_string_option(opt_idx, (char_u **)varp, errmsg = did_set_string_option(opt_idx, (char_u **)varp,
new_value_alloced, oldval, errbuf, opt_flags); new_value_alloced, oldval, errbuf, opt_flags);
/* If error detected, print the error message. */ // If error detected, print the error message.
if (errmsg != NULL) if (errmsg != NULL) {
xfree(saved_origval);
goto skip; goto skip;
}
if (saved_origval != NULL) { if (saved_origval != NULL) {
char_u buf_type[7]; char_u buf_type[7];
vim_snprintf((char *)buf_type, ARRAY_SIZE(buf_type), "%s", vim_snprintf((char *)buf_type, ARRAY_SIZE(buf_type), "%s",