1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

win32: fix a potential memory leak in Curl_load_library

If a call to GetSystemDirectory fails, the `path` pointer that was
previously allocated would be leaked. This makes sure that `path` is
always freed.

Closes #938
This commit is contained in:
Martin Vejnár 2016-08-01 10:18:55 +02:00 committed by Daniel Stenberg
parent d6604524ad
commit 608b11a91f

View File

@ -281,8 +281,8 @@ HMODULE Curl_load_library(LPCTSTR filename)
pLoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) :
LoadLibrary(path);
free(path);
}
free(path);
}
}