patch 9.1.0341: Problem: a few memory leaks are found
Problem: a few memory leaks are found
(LuMingYinDetect )
Solution: properly free the memory
Fixes the following problems:
- Memory leak in f_maplist()
fixes: #14486
- Memory leak in option.c
fixes: #14485
- Memory leak in f_resolve()
fixes: #14484
- Memory leak in f_autocmd_get()
related: #14474
- Memory leak in dict_extend_func()
fixes: #14477
fixes: #14238
closes: #14517
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@ -3406,7 +3406,10 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
|
||||
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",
|
||||
@ -3421,7 +3424,10 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
|
||||
|| dict_add_bool(event_dict, "once", ac->once) == FAIL
|
||||
|| dict_add_bool(event_dict, "nested",
|
||||
ac->nested) == FAIL)
|
||||
{
|
||||
vim_free(pat);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user