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; }