Marcus Meissner : winhttp: Do not free name too early (Coverity).

Alexandre Julliard julliard at winehq.org
Fri Dec 28 15:05:15 CST 2012


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

Author: Marcus Meissner <meissner at suse.de>
Date:   Thu Dec 27 19:43:27 2012 +0100

winhttp: Do not free name too early (Coverity).

---

 dlls/winhttp/session.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index c360a7e..d5aa153 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -1247,7 +1247,6 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
             strcpy( name, "wpad" );
             strcat( name, p );
             res = getaddrinfo( name, NULL, NULL, &ai );
-            heap_free( name );
             if (!res)
             {
                 *url = build_wpad_url( name, ai );
@@ -1255,10 +1254,12 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
                 if (*url)
                 {
                     TRACE("returning %s\n", debugstr_w(*url));
+                    heap_free( name );
                     ret = TRUE;
                     break;
                 }
             }
+            heap_free( name );
             p++;
         }
         heap_free( domain );




More information about the wine-cvs mailing list