Andrew Talbot : wininet: Fix a memory leak.

Alexandre Julliard julliard at winehq.org
Fri Oct 12 05:23:06 CDT 2007


Module: wine
Branch: master
Commit: 2b8a6a3a061778aaf3945ee826cc9ccbb11745b4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2b8a6a3a061778aaf3945ee826cc9ccbb11745b4

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Thu Oct 11 22:00:17 2007 +0100

wininet: Fix a memory leak.

---

 dlls/wininet/cookie.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c
index abf897a..31a0e19 100644
--- a/dlls/wininet/cookie.c
+++ b/dlls/wininet/cookie.c
@@ -369,12 +369,16 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
     {
         szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
         if( !szCookieData )
-            return FALSE;
-
-        r = InternetGetCookieW( szUrl, szCookieName, szCookieData, &len );
+        {
+            r = FALSE;
+        }
+        else
+        {
+            r = InternetGetCookieW( szUrl, szCookieName, szCookieData, &len );
 
-        *lpdwSize = WideCharToMultiByte( CP_ACP, 0, szCookieData, len,
-                                lpCookieData, *lpdwSize, NULL, NULL );
+            *lpdwSize = WideCharToMultiByte( CP_ACP, 0, szCookieData, len,
+                                    lpCookieData, *lpdwSize, NULL, NULL );
+        }
     }
 
     HeapFree( GetProcessHeap(), 0, szCookieData );




More information about the wine-cvs mailing list