wininet: Free the mem unconditionally to prevent a potential leak (Smatch).

Michael Stefaniuc mstefani at redhat.de
Wed Dec 2 17:41:55 CST 2009


---
Hans, url doesn't need to be kept if one of InternetCreateUrlW() or
CreateUrlCacheEntryW() fail, right?


 dlls/wininet/ftp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 48a7a95..bbef8ca 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -1397,8 +1397,8 @@ HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
                     HeapFree(GetProcessHeap(), 0, lpwh->cache_file);
                     lpwh->cache_file = NULL;
                 }
-                HeapFree(GetProcessHeap(), 0, url);
             }
+            HeapFree(GetProcessHeap(), 0, url);
         }
         HeapFree(GetProcessHeap(), 0, uc.lpszUrlPath);
     }
-- 
1.6.5.3


-- 
Michael Stefaniuc                           Tel.: +49-711-96437-199
Consulting Communications Engineer          Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach
Handelsregister: Amtsgericht Muenchen HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
                 Charles Cachera



More information about the wine-patches mailing list