diff options
-rw-r--r-- | src/tool_doswin.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 012ede5ac..f360b92e6 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -678,9 +678,11 @@ CURLcode FindWin32CACert(struct OperationConfig *config, struct curl_slist *GetLoadedModulePaths(void) { HANDLE hnd = INVALID_HANDLE_VALUE; - MODULEENTRY32 mod = { sizeof(mod), }; + MODULEENTRY32 mod = {0}; struct curl_slist *slist = NULL; + mod.dwSize = sizeof(MODULEENTRY32); + do { hnd = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0); } while(hnd == INVALID_HANDLE_VALUE && GetLastError() == ERROR_BAD_LENGTH); |