Andrew Talbot : urlmon: Fix some memory leaks.

Alexandre Julliard julliard at winehq.org
Wed Oct 10 06:46:13 CDT 2007


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

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Fri Oct  5 21:52:08 2007 +0100

urlmon: Fix some memory leaks.

---

 dlls/urlmon/sec_mgr.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index 52e29b6..6330906 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -318,6 +318,8 @@ static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *ifa
 
         static const BYTE secidFile[] = {'f','i','l','e',':'};
 
+        HeapFree(GetProcessHeap(), 0, buf);
+
         if(*pcbSecurityId < sizeof(secidFile)+sizeof(zone))
             return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
 
@@ -341,8 +343,10 @@ static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *ifa
 
     len = WideCharToMultiByte(CP_ACP, 0, buf, -1, NULL, 0, NULL, NULL)-1;
 
-    if(len+sizeof(DWORD) > *pcbSecurityId)
+    if(len+sizeof(DWORD) > *pcbSecurityId) {
+        HeapFree(GetProcessHeap(), 0, buf);
         return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
+    }
 
     WideCharToMultiByte(CP_ACP, 0, buf, -1, (LPSTR)pbSecurityId, -1, NULL, NULL);
     HeapFree(GetProcessHeap(), 0, buf);




More information about the wine-cvs mailing list