changeset 7304:7da2c2a68547

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.
author bertrand
date Sat, 07 Sep 2002 08:15:57 +0000
parents e805ef05536c
children d6b3e5dac5e8
files libmpdemux/http.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
 	}