Hans Leidekker : winhttp: Fix a couple of memory leaks (valgrind).

Alexandre Julliard julliard at winehq.org
Tue May 13 14:23:46 CDT 2014


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue May 13 13:43:11 2014 +0200

winhttp: Fix a couple of memory leaks (valgrind).

---

 dlls/winhttp/net.c     |    1 +
 dlls/winhttp/request.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
index 7466d36..b751bf0 100644
--- a/dlls/winhttp/net.c
+++ b/dlls/winhttp/net.c
@@ -488,6 +488,7 @@ BOOL netconn_secure_connect( netconn_t *conn, WCHAR *hostname )
         }
     }
 
+    heap_free(read_buf);
 
     if(status != SEC_E_OK || res != ERROR_SUCCESS) {
         WARN("Failed to initialize security context failed: %08x\n", status);
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 374051a..54aa616 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -2250,6 +2250,8 @@ static BOOL handle_redirect( request_t *request, DWORD status )
             request->read_chunked = FALSE;
             request->read_chunked_eof = FALSE;
         }
+        else heap_free( hostname );
+
         if (!(ret = add_host_header( request, WINHTTP_ADDREQ_FLAG_REPLACE ))) goto end;
         if (!(ret = open_connection( request ))) goto end;
 
@@ -2278,7 +2280,6 @@ static BOOL handle_redirect( request_t *request, DWORD status )
     ret = TRUE;
 
 end:
-    if (!ret) heap_free( hostname );
     heap_free( location );
     return ret;
 }




More information about the wine-cvs mailing list