diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-11-07 12:47:40 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-08 18:05:12 +0200 |
commit | 12d3e0df9980822282f70dffad148b729dbee541 (patch) | |
tree | d298b2c8f5039eae7aeeb16dfd927bea0efcc134 /stream/http.c | |
parent | af4b23cd36cff0dc34cde59c6a154fd080d11216 (diff) | |
download | mpv-12d3e0df9980822282f70dffad148b729dbee541.tar.bz2 mpv-12d3e0df9980822282f70dffad148b729dbee541.tar.xz |
cleanup: don't check for NULL before free()
patch by Clément Bœsch, ubitux gmail com
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/http.c')
-rw-r--r-- | stream/http.c | 19 |
1 files changed, 9 insertions, 10 deletions
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_len<http_hdr->buffer_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; } |