winedump: Fix memory leak (Resend)

Andrew Talbot Andrew.Talbot at talbotville.com
Wed Jan 3 07:22:49 CST 2007


Is there anything wrong with this patch?

Thanks,

-- Andy.
---
Changelog:
    winedump: Fix memory leak.

diff -urN a/tools/winedump/pe.c b/tools/winedump/pe.c
--- a/tools/winedump/pe.c	2006-12-29 13:09:26.000000000 +0000
+++ b/tools/winedump/pe.c	2006-12-31 15:17:34.000000000 +0000
@@ -532,7 +532,12 @@
         printf("\n");
     }
     pFunc = RVA(exportDir->AddressOfFunctions, exportDir->NumberOfFunctions * sizeof(DWORD));
-    if (!pFunc) {printf("Can't grab functions' address table\n"); return;}
+    if (!pFunc)
+    {
+        printf("Can't grab functions' address table\n");
+        free(map);
+        return;
+    }
     for (i = 0; i < exportDir->NumberOfFunctions; i++)
     {
 	if (pFunc[i] && !(map[i / 32] & (1 << (i % 32))))



More information about the wine-patches mailing list