]> granicus.if.org Git - vim/commitdiff
patch 8.2.1975: Win32: memory leak when encoding conversion fails v8.2.1975
authorBram Moolenaar <Bram@vim.org>
Tue, 10 Nov 2020 21:03:40 +0000 (22:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Nov 2020 21:03:40 +0000 (22:03 +0100)
Problem:    Win32: memory leak when encoding conversion fails.
Solution:   Free the allocated memory. (Ken Takata, closes #7277)

src/os_win32.c
src/version.c

index 52573fe621cdc3cabb322ca2de6a5ab9f9219c0e..60c04632cbbfaab335efbeb630f947b8967a93d5 100644 (file)
@@ -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(
index 06fa4d041c86f72947f1a0488541b23cdca001d6..872c25a9b154821a744dc4f6381b2f7ba7ad028f 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1975,
 /**/
     1974,
 /**/