api helpers: Save/restore more values in try_enter/try_leave

This fixes memory leak reported by ASAN. This also somehow fixes test40, though 
I have no idea why except that that test yields memory leak report.
This commit is contained in:
ZyX
2017-07-16 22:03:31 +03:00
parent 3660535f02
commit 2a6423eba7
4 changed files with 14 additions and 3 deletions

View File

@@ -2341,8 +2341,6 @@ static bool color_cmdline(void)
return ret;
}
const int saved_force_abort = force_abort;
force_abort = true;
bool arg_allocated = false;
typval_T arg = {
.v_type = VAR_STRING,
@@ -2504,7 +2502,6 @@ color_cmdline_end:
if (can_free_cb) {
callback_free(&color_cb);
}
force_abort = saved_force_abort;
if (arg_allocated) {
tv_clear(&arg);
}