Commit 12df80a7 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

- Don't crash on double InternetCloseHandle.

- Test case for this.
parent 64d69b60
...@@ -192,7 +192,8 @@ LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet ) ...@@ -192,7 +192,8 @@ LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet )
EnterCriticalSection( &WININET_cs ); EnterCriticalSection( &WININET_cs );
if( (handle > 0) && ( handle <= WININET_dwMaxHandles ) ) if( (handle > 0) && ( handle <= WININET_dwMaxHandles ) &&
WININET_Handles[handle-1] )
info = WININET_AddRef( WININET_Handles[handle-1] ); info = WININET_AddRef( WININET_Handles[handle-1] );
LeaveCriticalSection( &WININET_cs ); LeaveCriticalSection( &WININET_cs );
......
...@@ -195,6 +195,8 @@ abort: ...@@ -195,6 +195,8 @@ abort:
if (hor != 0x0) { if (hor != 0x0) {
rc = InternetCloseHandle(hor); rc = InternetCloseHandle(hor);
ok ((rc != 0), "InternetCloseHandle of handle opened by HttpOpenRequestA failed\n"); ok ((rc != 0), "InternetCloseHandle of handle opened by HttpOpenRequestA failed\n");
rc = InternetCloseHandle(hor);
ok ((rc == 0), "Double close of handle opened by HttpOpenRequestA succeeded\n");
} }
if (hic != 0x0) { if (hic != 0x0) {
rc = InternetCloseHandle(hic); rc = InternetCloseHandle(hic);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment