# HG changeset patch # User reimar # Date 1126040457 0 # Node ID be6bbd50ec205a8e48e55559f10651ad402d4fa1 # Parent 42ad241f6e8c6196044b4ee9357c4ecf89de4b6f memleak fixes when invalid http url specified. diff -r 42ad241f6e8c -r be6bbd50ec20 libmpdemux/http.c --- a/libmpdemux/http.c Tue Sep 06 20:50:10 2005 +0000 +++ b/libmpdemux/http.c Tue Sep 06 21:00:57 2005 +0000 @@ -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); diff -r 42ad241f6e8c -r be6bbd50ec20 libmpdemux/network.c --- a/libmpdemux/network.c Tue Sep 06 20:50:10 2005 +0000 +++ b/libmpdemux/network.c Tue Sep 06 21:00:57 2005 +0000 @@ -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 *