Marcus Meissner : netprofm: fix memleak in error exit (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Sep 7 09:20:13 CDT 2015


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Mon Sep  7 09:07:56 2015 +0200

netprofm: fix memleak in error exit (Coverity).

---

 dlls/netprofm/list.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/netprofm/list.c b/dlls/netprofm/list.c
index 197ef68..33b2fa6 100644
--- a/dlls/netprofm/list.c
+++ b/dlls/netprofm/list.c
@@ -1681,7 +1681,11 @@ static void init_networks( struct list_manager *mgr )
     if (ret != ERROR_BUFFER_OVERFLOW) return;
 
     if (!(buf = heap_alloc( size ))) return;
-    if (GetAdaptersAddresses( WS_AF_UNSPEC, flags, NULL, buf, &size )) return;
+    if (GetAdaptersAddresses( WS_AF_UNSPEC, flags, NULL, buf, &size ))
+    {
+        heap_free( buf );
+        return;
+    }
 
     memset( &id, 0, sizeof(id) );
     for (aa = buf; aa; aa = aa->Next)




More information about the wine-cvs mailing list