From 12d3e0df9980822282f70dffad148b729dbee541 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 7 Nov 2010 12:47:40 +0000 Subject: cleanup: don't check for NULL before free() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/http.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'stream/http.c') diff --git a/stream/http.c b/stream/http.c index 0c8bb33f56..e6b0909996 100644 --- a/stream/http.c +++ b/stream/http.c @@ -309,17 +309,16 @@ void http_free( HTTP_header_t *http_hdr ) { HTTP_field_t *field, *field2free; if( http_hdr==NULL ) return; - if( http_hdr->protocol!=NULL ) free( http_hdr->protocol ); - if( http_hdr->uri!=NULL ) free( http_hdr->uri ); - if( http_hdr->reason_phrase!=NULL ) free( http_hdr->reason_phrase ); - if( http_hdr->field_search!=NULL ) free( http_hdr->field_search ); - if( http_hdr->method!=NULL ) free( http_hdr->method ); - if( http_hdr->buffer!=NULL ) free( http_hdr->buffer ); + free(http_hdr->protocol); + free(http_hdr->uri); + free(http_hdr->reason_phrase); + free(http_hdr->field_search); + free(http_hdr->method); + free(http_hdr->buffer); field = http_hdr->first_field; while( field!=NULL ) { field2free = field; - if (field->field_name) - free(field->field_name); + free(field->field_name); field = field->next; free( field2free ); } @@ -442,7 +441,7 @@ http_response_parse( HTTP_header_t *http_hdr ) { hdr_ptr = ptr+((*ptr=='\r')?2:1); } while( hdr_ptr<(http_hdr->buffer+pos_hdr_sep) ); - if( field!=NULL ) free( field ); + free(field); if( pos_hdr_sep+hdr_sep_lenbuffer_size ) { // Response has data! @@ -515,7 +514,7 @@ http_build_request( HTTP_header_t *http_hdr ) { memcpy( ptr, http_hdr->body, http_hdr->body_size ); } - if( uri ) free( uri ); + free(uri); return http_hdr->buffer; } -- cgit v1.2.3