diff --git a/libmpdemux/network.c b/libmpdemux/network.c index 0f6bde8c9a..627064b526 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -187,6 +187,13 @@ http_read_response( int fd ) { i = read( fd, response, BUFFER_SIZE ); if( i<0 ) { printf("Read failed\n"); + http_free( http_hdr ); + return NULL; + } + if( i==0 ) { + printf("http_read_response read 0 -ie- EOF\n"); + http_free( http_hdr ); + return NULL; } http_response_append( http_hdr, response, i ); } while( !http_is_header_entire( http_hdr ) ); @@ -353,7 +360,12 @@ printf("read %d bytes from buffer\n", len ); } if( len