]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0413: ASAN reports a memory leak v9.0.0413
authorK.Takata <kentkt@csc.jp>
Thu, 8 Sep 2022 09:55:38 +0000 (10:55 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 8 Sep 2022 09:55:38 +0000 (10:55 +0100)
Problem:    ASAN reports a memory leak.
Solution:   Free the string received from the server. (Ken Takata,
            closes #11080)

src/clientserver.c
src/version.c

index bb2108d7d4ebd6dec3143067b49b50ce57135d95..eaaba2572a8d042392cc59f8f94f5ae612ae6dec 100644 (file)
@@ -423,9 +423,7 @@ cmdsrv_main(
            if (argtype == ARGTYPE_EDIT_WAIT)
            {
                int     numFiles = *argc - i - 1;
-               int     j;
                char_u  *done = alloc(numFiles);
-               char_u  *p;
 # ifdef FEAT_GUI_MSWIN
                NOTIFYICONDATA ni;
                int     count = 0;
@@ -450,6 +448,8 @@ cmdsrv_main(
                vim_memset(done, 0, numFiles);
                while (memchr(done, 0, numFiles) != NULL)
                {
+                   char_u  *p;
+                   int     j;
 # ifdef MSWIN
                    p = serverGetReply(srv, NULL, TRUE, TRUE, 0);
                    if (p == NULL)
@@ -459,6 +459,7 @@ cmdsrv_main(
                        break;
 # endif
                    j = atoi((char *)p);
+                   vim_free(p);
                    if (j >= 0 && j < numFiles)
                    {
 # ifdef FEAT_GUI_MSWIN
index e243a4fc9bd0d12debb26b1493120f0788e22845..bff11c710dfefbf54200983667ca676314b2fb6b 100644 (file)
@@ -703,6 +703,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    413,
 /**/
     412,
 /**/