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/stream_dvb.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/stream_dvb.c')
-rw-r--r-- | stream/stream_dvb.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index ed8c1b81ec..13f32c29a8 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -402,8 +402,7 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type) fclose(f); if(list->NUM_CHANNELS == 0) { - if(list->channels != NULL) - free(list->channels); + free(list->channels); free(list); return NULL; } @@ -418,17 +417,13 @@ void dvb_free_config(dvb_config_t *config) for(i=0; i<config->count; i++) { - if(config->cards[i].name) - free(config->cards[i].name); + free(config->cards[i].name); if(!config->cards[i].list) continue; if(config->cards[i].list->channels) { for(j=0; j<config->cards[i].list->NUM_CHANNELS; j++) - { - if(config->cards[i].list->channels[j].name) - free(config->cards[i].list->channels[j].name); - } + free(config->cards[i].list->channels[j].name); free(config->cards[i].list->channels); } free(config->cards[i].list); @@ -801,20 +796,17 @@ dvb_config_t *dvb_get_config(void) if((access(conf_file, F_OK | R_OK) != 0)) { - if(conf_file) - free(conf_file); + free(conf_file); conf_file = get_path("channels.conf"); if((access(conf_file, F_OK | R_OK) != 0)) { - if(conf_file) - free(conf_file); + free(conf_file); conf_file = strdup(MPLAYER_CONFDIR "/channels.conf"); } } list = dvb_get_channels(conf_file, type); - if(conf_file) - free(conf_file); + free(conf_file); if(list == NULL) continue; |