[PATCH] cabinet: Fix memory leak (found by Smatch)

Rico Schüller kgbricola at web.de
Sun Dec 30 17:24:26 CST 2007


---
 dlls/cabinet/cabinet_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index 9e2c18a..6f92211 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -229,7 +229,11 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
                 file_in_list(pDestination->FileList, pfdin->psz1, &node);
 
                 if (node && !node->DoExtract)
+                {
+                    HeapFree(GetProcessHeap(), 0, szFullPath);
+                    HeapFree(GetProcessHeap(), 0, szDirectory);
                     return 0;
+                }
 
                 /* create the destination directory if it doesn't exist */
                 if (GetFileAttributesA(szDirectory) == INVALID_FILE_ATTRIBUTES)
-- 
1.5.3.3


--------------050700010202020902000809--



More information about the wine-devel mailing list