Mercurial > vim
comparison src/os_win32.c @ 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 | d8b95a9cdaaa |
children | ab8a9b9bd349 |
comparison
equal
deleted
inserted
replaced
22855:eb8514ea9e59 | 22856:3b476f974406 |
---|---|
3530 { | 3530 { |
3531 WCHAR *wn; | 3531 WCHAR *wn; |
3532 | 3532 |
3533 wn = enc_to_utf16(fname, NULL); | 3533 wn = enc_to_utf16(fname, NULL); |
3534 if (wn == NULL) | 3534 if (wn == NULL) |
3535 { | |
3536 vim_free(p); | |
3535 return NULL; | 3537 return NULL; |
3538 } | |
3536 | 3539 |
3537 // Try to retrieve the entire security descriptor. | 3540 // Try to retrieve the entire security descriptor. |
3538 err = GetNamedSecurityInfoW( | 3541 err = GetNamedSecurityInfoW( |
3539 wn, // Abstract filename | 3542 wn, // Abstract filename |
3540 SE_FILE_OBJECT, // File Object | 3543 SE_FILE_OBJECT, // File Object |