krnl386.exe: Don't try to free again an already freed global block.
authorAlexandre Julliard <julliard@winehq.org>
Wed, 3 Mar 2010 10:52:59 +0000 (11:52 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 3 Mar 2010 10:52:59 +0000 (11:52 +0100)
dlls/krnl386.exe16/global.c

index db07477b5ecd2410c28c387e95f7cb5ad4c0752e..ba4d7df645dbe08c9e1731dfe0d585c147e18a76 100644 (file)
@@ -182,6 +182,11 @@ BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle )
     sel = GlobalHandleToSel16( handle );
     if (!VALID_HANDLE(sel)) return FALSE;
     pArena = GET_ARENA_PTR(sel);
+    if (!pArena->size)
+    {
+        WARN( "already free %x\n", handle );
+        return FALSE;
+    }
     SELECTOR_FreeBlock( sel );
     memset( pArena, 0, sizeof(GLOBALARENA) );
     return TRUE;