aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-06 21:00:57 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-06 21:00:57 +0000
commite036d0cf353b3972a7c33b3cac7cfc84154c7a17 (patch)
treecd86825d8a17038e6b7c25af642fd424a3b63401 /libmpdemux
parente72392399bf2ba117d13034a272cbe542b2cbc83 (diff)
memleak fixes when invalid http url specified.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16418 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/http.c2
-rw-r--r--libmpdemux/network.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index a1adc38803..73fa04a36c 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -875,7 +875,7 @@ static int open_s1(stream_t *stream,int mode, void* opts, int* file_format) {
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 --git a/libmpdemux/network.c b/libmpdemux/network.c
index eadbb3f6ab..40caa468d9 100644
--- a/libmpdemux/network.c
+++ b/libmpdemux/network.c
@@ -417,7 +417,7 @@ http_send_request( URL_t *url, off_t pos ) {
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 @@ http_send_request( URL_t *url, off_t pos ) {
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 *