Skip to content

Commit beec32d

Browse files
committed
HttpGetFile: initialize output file handle to INVALID_HANDLE_VALUE
1 parent ee32c22 commit beec32d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Win32.xs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ XS(w32_HttpGetFile)
16971697
HINTERNET hSession = NULL,
16981698
hConnect = NULL,
16991699
hRequest = NULL;
1700-
HANDLE hOut = NULL;
1700+
HANDLE hOut = INVALID_HANDLE_VALUE;
17011701
BOOL bParsed = FALSE,
17021702
bAborted = FALSE,
17031703
bFileError = FALSE,
@@ -1935,7 +1935,7 @@ XS(w32_HttpGetFile)
19351935
(void) DeleteFileW(file);
19361936

19371937
/* Close any open handles. */
1938-
if (hOut) CloseHandle(hOut);
1938+
if (hOut != INVALID_HANDLE_VALUE) CloseHandle(hOut);
19391939
if (hRequest) WinHttpCloseHandle(hRequest);
19401940
if (hConnect) WinHttpCloseHandle(hConnect);
19411941
if (hSession) WinHttpCloseHandle(hSession);

0 commit comments

Comments
 (0)