From: Martin Vejnár Date: Mon, 1 Aug 2016 08:18:55 +0000 (+0200) Subject: win32: fix a potential memory leak in Curl_load_library X-Git-Tag: curl-7_50_1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=608b11a91f4e994d26f99baf4dd0a7dff03578ab;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/system_win32.c b/lib/system_win32.c index 2ba7d0bc1c..d6a998b275 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -281,8 +281,8 @@ HMODULE Curl_load_library(LPCTSTR filename) pLoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) : LoadLibrary(path); - free(path); } + free(path); } }