diff src/os_win32.c @ 16046:884b683d12e9 v8.1.1028

patch 8.1.1028: MS-Windows: memory leak when creating terminal fails commit https://github.com/vim/vim/commit/9029b918f902c01e8f46441155ec2f01690929f9 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 21 19:58:00 2019 +0100 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 https://github.com/vim/vim/issues/4138)
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 Mar 2019 20:00:06 +0100
parents 7e33709a3d0a
children 82cbb08ae0f9
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -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;