]> granicus.if.org Git - vim/commitdiff
patch 8.2.2844: Vim9: memory leak when using searchpair() v8.2.2844
authorBram Moolenaar <Bram@vim.org>
Fri, 7 May 2021 18:43:54 +0000 (20:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 7 May 2021 18:43:54 +0000 (20:43 +0200)
Problem:    Vim9: memory leak when using searchpair().
Solution:   Free the v_instr field.

src/typval.c
src/version.c

index 4bde94e19221f9e9a816fa841cf3b26358655450..9ca35699d595bc7d9c94a9d36f573bc26b86b2ce 100644 (file)
@@ -151,10 +151,13 @@ clear_tv(typval_T *varp)
                channel_unref(varp->vval.v_channel);
                varp->vval.v_channel = NULL;
 #endif
+               break;
+           case VAR_INSTR:
+               VIM_CLEAR(varp->vval.v_instr);
+               break;
            case VAR_UNKNOWN:
            case VAR_ANY:
            case VAR_VOID:
-           case VAR_INSTR:
                break;
        }
        varp->v_lock = 0;
index 01c77921cf9c0b1987ef6d01294ad3f2da309031..68f05af9fe9d5f16605a43de4a0e54c84a2bd54f 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2844,
 /**/
     2843,
 /**/