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
This commit is contained in:
bertrand 2002-09-07 08:15:57 +00:00
parent 08cdd6368b
commit e620b2a53c
1 changed files with 2 additions and 2 deletions

View File

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