changeset 22856:3b476f974406 v8.2.1975

patch 8.2.1975: Win32: memory leak when encoding conversion fails Commit: https://github.com/vim/vim/commit/bbf9f344afd08954163191ed678352fb554fc254 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 10 22:03:40 2020 +0100 patch 8.2.1975: Win32: memory leak when encoding conversion fails Problem: Win32: memory leak when encoding conversion fails. Solution: Free the allocated memory. (Ken Takata, closes https://github.com/vim/vim/issues/7277)
author Bram Moolenaar <Bram@vim.org>
date Tue, 10 Nov 2020 22:15:03 +0100
parents eb8514ea9e59
children e1bf42c2493a
files src/os_win32.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -3532,7 +3532,10 @@ mch_get_acl(char_u *fname)
 
 	wn = enc_to_utf16(fname, NULL);
 	if (wn == NULL)
+	{
+	    vim_free(p);
 	    return NULL;
+	}
 
 	// Try to retrieve the entire security descriptor.
 	err = GetNamedSecurityInfoW(
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1975,
+/**/
     1974,
 /**/
     1973,