From 608b11a91f4e994d26f99baf4dd0a7dff03578ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Vejn=C3=A1r?= Date: Mon, 1 Aug 2016 10:18:55 +0200 Subject: 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 --- lib/system_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/system_win32.c b/lib/system_win32.c index 2ba7d0bc1..d6a998b27 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); } } -- cgit v1.2.3