[MPlayer-cvslog] CVS: main/libmpdemux http.c, 1.28, 1.29 network.c, 1.115, 1.116

Reimar Döffinger CVS syncmail at mplayerhq.hu
Tue Sep 6 23:00:59 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv4133

Modified Files:
	http.c network.c 
Log Message:
memleak fixes when invalid http url specified.


Index: http.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/http.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- http.c	24 Jul 2005 12:22:30 -0000	1.28
+++ http.c	6 Sep 2005 21:00:57 -0000	1.29
@@ -875,7 +875,7 @@
 	stream->streaming_ctrl->bandwidth = network_bandwidth;
 	url = url_new(stream->url);
 	stream->streaming_ctrl->url = check4proxies(url);
-	//url_free(url);
+	url_free(url);
 	
 	mp_msg(MSGT_OPEN, MSGL_INFO, "STREAM_HTTP(1), URL: %s\n", stream->url);
 	seekable = http_streaming_start(stream, file_format);

Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- network.c	19 Jul 2005 12:07:04 -0000	1.115
+++ network.c	6 Sep 2005 21:00:57 -0000	1.116
@@ -417,7 +417,7 @@
 	http_set_field( http_hdr, "Connection: close");
 	http_add_basic_authentication( http_hdr, url->username, url->password );
 	if( http_build_request( http_hdr )==NULL ) {
-		return -1;
+		goto err_out;
 	}
 
 	if( proxy ) {
@@ -429,19 +429,22 @@
 		fd = connect2Server( server_url->hostname, server_url->port,1 );
 	}
 	if( fd<0 ) {
-		return -1; 
+		goto err_out;
 	}
 	mp_msg(MSGT_NETWORK,MSGL_DBG2,"Request: [%s]\n", http_hdr->buffer );
 	
 	ret = send( fd, http_hdr->buffer, http_hdr->buffer_size, 0 );
 	if( ret!=(int)http_hdr->buffer_size ) {
 		mp_msg(MSGT_NETWORK,MSGL_ERR,"Error while sending HTTP request: didn't sent all the request\n");
-		return -1;
+		goto err_out;
 	}
 	
 	http_free( http_hdr );
 
 	return fd;
+err_out:
+	http_free(http_hdr);
+	return -1;
 }
 
 HTTP_header_t *




More information about the MPlayer-cvslog mailing list