summaryrefslogtreecommitdiffstats
path: root/src/dict.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-04-16 22:44:31 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-16 22:44:31 +0200
commit29269a71b5ac8a87c6c4beca35c173a19a2c9398 (patch)
tree64da5504c5544f9d9e0ead921246bc0ad7caef0c /src/dict.c
parentf7d31adcc22eae852d6e7a5b59e9755ba7b51d35 (diff)
patch 9.1.0341: Problem: a few memory leaks are foundv9.1.0341
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>
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dict.c b/src/dict.c
index 508d00cdf7..c78995d80e 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -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;
}