]> granicus.if.org Git - vim/commitdiff
patch 8.2.2968: Vim9: memory leak v8.2.2968
authorBram Moolenaar <Bram@vim.org>
Wed, 9 Jun 2021 18:50:46 +0000 (20:50 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Jun 2021 18:50:46 +0000 (20:50 +0200)
Problem:    Vim9: memory leak
Solution:   Unreference pt_outer of partial.

src/eval.c
src/version.c

index 46d8ca3a82d71d624b92b73c216c1fe16d2267e0..b6bee5af50cca04c5f8c8f3f0013d946b7792b52 100644 (file)
@@ -4301,6 +4301,9 @@ partial_free(partial_T *pt)
     else
        func_ptr_unref(pt->pt_func);
 
+    // "out_up" is no longer used, decrement refcount on partial that owns it.
+    partial_unref(pt->pt_outer.out_up_partial);
+
     // Decrease the reference count for the context of a closure.  If down
     // to the minimum it may be time to free it.
     if (pt->pt_funcstack != NULL)
index 77b4ed08bafead6e8e0347825a333038dec17d7f..d03113602881524abd58063c10b24537351ff0db 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2968,
 /**/
     2967,
 /**/