changeset 16419:0d860b6d64e6

memleak fixes when using an http proxy
author reimar
date Tue, 06 Sep 2005 21:14:55 +0000
parents 264b3b909850
children 17aad1da6c1d
files libmpdemux/network.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/network.c	Tue Sep 06 21:08:36 2005 +0000
+++ b/libmpdemux/network.c	Tue Sep 06 21:14:55 2005 +0000
@@ -343,6 +343,7 @@
 			if (network_ipv4_only_proxy && (gethostbyname(url->hostname)==NULL)) {
 				mp_msg(MSGT_NETWORK,MSGL_WARN,
 					"Could not find resolve remote hostname for AF_INET. Trying without proxy.\n");
+				url_free(proxy_url);
 				return url_out;
 			}
 #endif
@@ -352,11 +353,14 @@
 			new_url = malloc( len+1 );
 			if( new_url==NULL ) {
 				mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed\n");
+				url_free(proxy_url);
 				return url_out;
 			}
 			sprintf(new_url, "http_proxy://%s:%d/%s", proxy_url->hostname, proxy_url->port, url->url );
 			tmp_url = url_new( new_url );
 			if( tmp_url==NULL ) {
+				free( new_url );
+				url_free( proxy_url );
 				return url_out;
 			}
 			url_free( url_out );