patch 8.1.1028: MS-Windows: memory leak when creating terminal fails
Problem: MS-Windows: memory leak when creating terminal fails.
Solution: Free the command. (Ken Takata, closes #4138)
diff --git a/src/os_win32.c b/src/os_win32.c
index ff11777..7930957 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4866,7 +4866,10 @@
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;
diff --git a/src/version.c b/src/version.c
index ee8a4d6..cebd920 100644
--- a/src/version.c
+++ b/src/version.c
@@ -780,6 +780,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1028,
+/**/
1027,
/**/
1026,