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:
Christian Brabandt
2024-04-16 22:44:31 +02:00
parent f7d31adcc2
commit 29269a71b5
7 changed files with 27 additions and 0 deletions

View File

@ -1300,12 +1300,18 @@ dict_extend_func(
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;
}