summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-30 17:09:05 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-30 17:09:05 +0000
commitd293981d2b76b40013143fe2302b910585e50808 (patch)
tree87e99a889ddfb0344376b4553a14963de88a25cb /src/vim9compile.c
parent94f3192b03ed27474db80b4d3a409e107140738b (diff)
downloadvim-git-d293981d2b76b40013143fe2302b910585e50808.tar.gz
patch 8.2.3951: Vim9: memory leak when text after a nested functionv8.2.3951
Problem: Vim9: memory leak when text after a nested function. Solution: Free the function if text is found after "enddef".
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8882bfe10..272368e76 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -889,6 +889,7 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free)
semsg(_(e_text_found_after_str_str),
eap->cmdidx == CMD_def ? "enddef" : "endfunction", eap->nextcmd);
r = FAIL;
+ func_ptr_unref(ufunc);
goto theend;
}