]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0055: memory leak in ExpandFromContext() v9.2.0055
authorHuihui Huang <625173@qq.com>
Wed, 25 Feb 2026 20:04:07 +0000 (20:04 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 25 Feb 2026 20:04:07 +0000 (20:04 +0000)
Problem:  memory leak in ExpandFromContext()
Solution: Free the variable (Huihui Huang).

fixes:  #19500
closes: #19505

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

index 61cfe5bc3b74aebfaafb26e85cfb81c44dd53dd7..4916465e8a36026eab59482efdcd65dd01de8540 100644 (file)
@@ -3515,8 +3515,10 @@ ExpandFromContext(
     {
        regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
        if (regmatch.regprog == NULL)
+       {
+           vim_free(tofree);
            return FAIL;
-
+       }
        // set ignore-case according to p_ic, p_scs and pat
        regmatch.rm_ic = ignorecase(pat);
     }
index 473a64fb53435fc0eb4ea7b1fd8cc360e75de0d0..40e00fc2bf31e06667d59805d5adbb503bee907b 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    55,
 /**/
     54,
 /**/