summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-13 15:39:00 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-13 15:39:00 +0200
commitc2dec4cac4087af90dd4f64f4912a8e14a5fdd56 (patch)
tree3dff50bb8724d737263951f470d4c3d2463c4512 /src/vim9compile.c
parentc3a27bbd53a4653c2d8122a047a4cf2cfc52ed21 (diff)
downloadvim-git-c2dec4cac4087af90dd4f64f4912a8e14a5fdd56.tar.gz
patch 8.2.2989: Vim9: memory leak when debugging a :def functionv8.2.2989
Problem: Vim9: memory leak when debugging a :def function. Solution: Free the debug instructions.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 1747f30fd..be8f30452 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -10045,6 +10045,13 @@ delete_def_function_contents(dfunc_T *dfunc, int mark_deleted)
VIM_CLEAR(dfunc->df_instr);
dfunc->df_instr = NULL;
}
+ if (dfunc->df_instr_debug != NULL)
+ {
+ for (idx = 0; idx < dfunc->df_instr_debug_count; ++idx)
+ delete_instr(dfunc->df_instr_debug + idx);
+ VIM_CLEAR(dfunc->df_instr_debug);
+ dfunc->df_instr_debug = NULL;
+ }
#ifdef FEAT_PROFILE
if (dfunc->df_instr_prof != NULL)
{