summaryrefslogtreecommitdiff
path: root/lib/system_win32.c
diff options
context:
space:
mode:
authorMartin Vejnár <martin.vejnar@avg.com>2016-08-01 10:18:55 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-08-01 10:43:10 +0200
commit608b11a91f4e994d26f99baf4dd0a7dff03578ab (patch)
tree90cb4728c80f29159ecda28fb5183b9ca543895e /lib/system_win32.c
parentd6604524ad24daf4581efbe0020da058d2b3af84 (diff)
downloadcurl-608b11a91f4e994d26f99baf4dd0a7dff03578ab.tar.gz
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
Diffstat (limited to 'lib/system_win32.c')
-rw-r--r--lib/system_win32.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}