[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Don't try to MEM_DEBUG with SHFree(0)
From:       Uwe Bonnes <bon () elektron ! ikp ! physik ! tu-darmstadt ! de>
Date:       2000-02-27 15:14:20
[Download RAW message or body]

Changelog:
	dlls/shell32/shellord.c: SHFree()
	     Don't dereference NULL

Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Free Software: If you contribute nothing, expect nothing
--
Index: wine/dlls/shell32/shellord.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shellord.c,v
retrieving revision 1.57
diff -u -r1.57 shellord.c
--- wine/dlls/shell32/shellord.c        2000/02/26 18:45:09     1.57
+++ wine/dlls/shell32/shellord.c        2000/02/27 08:10:32
@@ -405,8 +405,11 @@
 DWORD WINAPI SHFree(LPVOID x) 
 {
 #if MEM_DEBUG
-       WORD len = *(LPWORD)((LPBYTE)x-2);
+       WORD len;
 
+       if (x)
+         {
+       len = *(LPWORD)((LPBYTE)x-2);
        if ( *(LPWORD)((LPBYTE)x+len) != 0x7384)
          ERR("MAGIC2!\n");
 
@@ -418,9 +421,12 @@
        TRACE("%p len=%u\n",x, len);
 
        x = (LPBYTE) x - 4;
+         }
 #else
        TRACE("%p\n",x);
 #endif
+       if (!x)
+         WARN("for NULL requested\n");
        return HeapFree(GetProcessHeap(), 0, x);
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic