]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0133: memory leak in netbeans_file_activated() v9.2.0133
authorHuihui Huang <625173@qq.com>
Tue, 10 Mar 2026 19:33:22 +0000 (19:33 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 10 Mar 2026 19:33:22 +0000 (19:33 +0000)
Problem:  memory leak in netbeans_file_activated()
Solution: Free q on early return (Huihui Huang).

closes: #19626

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/netbeans.c
src/version.c

index 516ac16da63b787f80d80ac03b1f6ccbf41c05f2..976a2574a1a73a672bccc9e2865633fd9cbe6fd6 100644 (file)
@@ -2603,8 +2603,13 @@ netbeans_file_activated(buf_T *bufp)
        return;
 
     q = nb_quote(bufp->b_ffname);
-    if (q == NULL || bp == NULL)
+    if (q == NULL)
+       return;
+    if (bp == NULL)
+    {
+       vim_free(q);
        return;
+    }
 
     vim_snprintf(buffer, sizeof(buffer),  "%d:fileOpened=%d \"%s\" %s %s\n",
            bufno,
index e65ab8298c1dcef85ba6df793cfddf5932406f3e..7d7c7e4dc967315cc823bc5517d827fd4cf49e46 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    133,
 /**/
     132,
 /**/