wininet: Fix a memory leak
Andrew Talbot
andrew.talbot at talbotville.com
Thu Oct 11 16:00:17 CDT 2007
Changelog:
wininet: Fix a memory leak.
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 lp
{
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-patches
mailing list