From 636ac85b859f1b4a4f40c28687cc43aa60ba8a05 Mon Sep 17 00:00:00 2001 From: OV2 Date: Thu, 24 May 2018 18:22:20 +0200 Subject: [PATCH] win32: free allocated full path --- win32/_tfwopen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/win32/_tfwopen.cpp b/win32/_tfwopen.cpp index dbd703ac..8e328aca 100644 --- a/win32/_tfwopen.cpp +++ b/win32/_tfwopen.cpp @@ -232,6 +232,7 @@ extern "C" int _twopen(const char *filename, int oflag, int pmode) { extern "C" void _twfullpath(char* dst, const char* src, int len) { wchar_t *resolved = _wfullpath(NULL, Utf8ToWide(src), MAX_PATH); strncpy(dst, WideToUtf8(resolved), len); + free(resolved); dst[len - 1] = '\0'; return; }