summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-07 08:15:57 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-07 08:15:57 +0000
commite620b2a53ce5fb13fd6ed7089081c82b60015482 (patch)
tree21761fe24f27a2eaabe61217fc5ad1cb3e9cce5f /libmpdemux
parent08cdd6368b8b70ba7fe4931502dadfb436bbc76f (diff)
downloadmpv-e620b2a53ce5fb13fd6ed7089081c82b60015482.tar.bz2
mpv-e620b2a53ce5fb13fd6ed7089081c82b60015482.tar.xz
Check if realloc failed on http_hdr->buffer instead of ptr in http_response_append,
and got rid of ptr which wasn't used anymore. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index 4d6491644f..97981ae9e5 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -45,10 +45,10 @@ http_free( HTTP_header_t *http_hdr ) {
int
http_response_append( HTTP_header_t *http_hdr, char *response, int length ) {
- char *ptr;
if( http_hdr==NULL || response==NULL || length<0 ) return -1;
+
http_hdr->buffer = (char*)realloc( http_hdr->buffer, http_hdr->buffer_size+length+1 );
- if( ptr==NULL ) {
+ if( http_hdr->buffer==NULL ) {
mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory (re)allocation failed\n");
return -1;
}