win32: free allocated full path

This commit is contained in:
OV2 2018-05-24 18:22:20 +02:00
parent ba76c1c2be
commit 636ac85b85

View File

@ -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;
}