wldap32: Missing HeapFree on error path (found by Smatch).

Michael Stefaniuc mstefani at redhat.de
Mon Feb 12 17:02:34 CST 2007


---
 dlls/wldap32/page.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/wldap32/page.c b/dlls/wldap32/page.c
index cfea875..cc1d0af 100644
--- a/dlls/wldap32/page.c
+++ b/dlls/wldap32/page.c
@@ -114,7 +114,10 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
 
     ctrl = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) );
     if (!ctrl)
+    {
+        HeapFree( GetProcessHeap(), 0, val );
         return WLDAP32_LDAP_NO_MEMORY;
+    }
 
     ctrl->ldctl_oid = strAtoW( LDAP_PAGED_RESULT_OID_STRING );
     ctrl->ldctl_value.bv_len = len;
-- 
1.4.4.2


-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070213/1538fa6f/attachment.pgp


More information about the wine-patches mailing list