event_dict = dict_alloc();
if (event_dict == NULL
|| list_append_dict(event_list, event_dict) == FAIL)
+ {
+ vim_free(pat);
return;
+ }
if (dict_add_string(event_dict, "event", event_name) == FAIL
|| dict_add_string(event_dict, "group",
|| dict_add_bool(event_dict, "once", ac->once) == FAIL
|| dict_add_bool(event_dict, "nested",
ac->nested) == FAIL)
+ {
+ vim_free(pat);
return;
+ }
}
}
}
action = tv_get_string_chk(&argvars[2]);
if (action == NULL)
+ {
+ if (is_new)
+ dict_unref(d1);
return;
+ }
for (i = 0; i < 3; ++i)
if (STRCMP(action, av[i]) == 0)
break;
if (i == 3)
{
+ if (is_new)
+ dict_unref(d1);
semsg(_(e_invalid_argument_str), action);
return;
}
if (buf == NULL)
{
vim_free(p);
+ vim_free(remain);
goto fail;
}
if ((d = dict_alloc()) == NULL)
return;
if (list_append_dict(rettv->vval.v_list, d) == FAIL)
+ {
+ dict_unref(d);
return;
+ }
keys_buf = NULL;
did_simplify = FALSE;
opt_idx = findoption((char_u *)name);
if (opt_idx < 0)
+ {
+ vim_free(p);
return;
+ }
if (options[opt_idx].flags & P_DEF_ALLOCED)
vim_free(options[opt_idx].def_val[VI_DEFAULT]);
delfunc TestIdx
endfunc
+func Test_extendnew_leak()
+ " This used to leak memory
+ for i in range(100) | silent! call extendnew([], [], []) | endfor
+ for i in range(100) | silent! call extendnew({}, {}, {}) | endfor
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 341,
/**/
340,
/**/