- Don't crash on double InternetCloseHandle.

- Test case for this.
This commit is contained in:
Robert Shearman 2004-09-23 22:53:04 +00:00 committed by Alexandre Julliard
parent 64d69b60c9
commit 12df80a748
2 changed files with 4 additions and 1 deletions

View File

@ -192,7 +192,8 @@ LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet )
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] );
LeaveCriticalSection( &WININET_cs );

View File

@ -195,6 +195,8 @@ abort:
if (hor != 0x0) {
rc = InternetCloseHandle(hor);
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) {
rc = InternetCloseHandle(hic);