# HG changeset patch # User bertrand # Date 1031386557 0 # Node ID 7da2c2a68547003db65db708d17cd57fc4cd4bfa # Parent e805ef05536c68c471b10148ae17074e0d47d16f 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. diff -r e805ef05536c -r 7da2c2a68547 libmpdemux/http.c --- a/libmpdemux/http.c Fri Sep 06 22:53:26 2002 +0000 +++ b/libmpdemux/http.c Sat Sep 07 08:15:57 2002 +0000 @@ -45,10 +45,10 @@ 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; }