]> granicus.if.org Git - vim/commitdiff
patch 8.1.1028: MS-Windows: memory leak when creating terminal fails v8.1.1028
authorBram Moolenaar <Bram@vim.org>
Thu, 21 Mar 2019 18:58:00 +0000 (19:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 21 Mar 2019 18:58:00 +0000 (19:58 +0100)
Problem:    MS-Windows: memory leak when creating terminal fails.
Solution:   Free the command. (Ken Takata, closes #4138)

src/os_win32.c
src/version.c

index ff1177722031bae886165e112b899d9a61edcc1f..7930957ad3306b9d95a0df3a86e168ef644abc01 100644 (file)
@@ -4866,7 +4866,10 @@ mch_call_shell_terminal(
     argvar[1].v_type = VAR_UNKNOWN;
     buf = term_start(argvar, NULL, &opt, TERM_START_SYSTEM);
     if (buf == NULL)
+    {
+       vim_free(newcmd);
        return 255;
+    }
 
     job = term_getjob(buf->b_term);
     ++job->jv_refcount;
index ee8a4d6dd4d8b5e925a4255c4df6a0c1100aa1cd..cebd9207c13dd1be15fcedfe3260b90201c172f9 100644 (file)
@@ -779,6 +779,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1028,
 /**/
     1027,
 /**/