cabinet: Reorder code to make sure str is freed (coverity)

André Hentschel nerv at dawncrow.de
Thu Oct 25 14:29:13 CDT 2012


CID 713340
---
 dlls/cabinet/cabinet_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/cabinet/cabinet_main.c b/dlls/cabinet/cabinet_main.c
index 1f0daf8..ef6698d 100644
--- a/dlls/cabinet/cabinet_main.c
+++ b/dlls/cabinet/cabinet_main.c
@@ -365,6 +365,7 @@ HRESULT WINAPI Extract(SESSION *dest, LPCSTR szCabName)
 
     if ((end = strrchr(str, '\\')))
     {
+        path = str;
         end++;
         name = HeapAlloc( GetProcessHeap(), 0, strlen(end) + 1 );
         if (!name)
@@ -374,7 +375,6 @@ HRESULT WINAPI Extract(SESSION *dest, LPCSTR szCabName)
         }
         strcpy( name, end );
         *end = 0;
-        path = str;
     }
     else
     {
-- 
1.8.0



-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list