diff options
author | iive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-12-30 13:23:39 +0000 |
---|---|---|
committer | iive <iive@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-12-30 13:23:39 +0000 |
commit | a36aff154c79988b42afc624164a8d79cbf7a695 (patch) | |
tree | 7bf178ec0d3970f6b0c4ef5ceddf2203e2fd547f /stream | |
parent | 74ec945b2044a6ce47c0ca37156bc1a3fd1cde12 (diff) | |
download | mpv-a36aff154c79988b42afc624164a8d79cbf7a695.tar.bz2 mpv-a36aff154c79988b42afc624164a8d79cbf7a695.tar.xz |
Fix double free of *http_hdr at server error.
In http.c::http_streaming_start() *http_hdr is allocated
then assigned to stream->streaming_ctrl->data
if server returns error *http_hdr is freed before function returns.
However the copy in ->data remains and is
later freed (again) by network.c::streaming_ctrl_free().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21792 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r-- | stream/http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/http.c b/stream/http.c index 79ad7b1031..42c226b16c 100644 --- a/stream/http.c +++ b/stream/http.c @@ -749,8 +749,6 @@ static int http_streaming_start(stream_t *stream, int* file_format) { http_debug_hdr( http_hdr ); } - stream->streaming_ctrl->data = (void*)http_hdr; - // Check if we can make partial content requests and thus seek in http-streams if( http_hdr!=NULL && http_hdr->status_code==200 ) { char *accept_ranges; @@ -858,7 +856,9 @@ err_out: fd = -1; res = STREAM_UNSUPORTED; http_free( http_hdr ); + http_hdr = NULL; out: + stream->streaming_ctrl->data = (void*)http_hdr; stream->fd = fd; return res; } |