diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-11 16:17:11 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-12-11 16:17:11 +0100 |
commit | ce072469888db55316d648918229f2b83fc5e7cf (patch) | |
tree | 1d995bd3d70d9a9e341cdd894f14e4cb761ead40 /src/input | |
parent | 974c78a88db16711f89f50c8e3f5c98dd4a29c02 (diff) | |
download | xine-lib-ce072469888db55316d648918229f2b83fc5e7cf.tar.gz xine-lib-ce072469888db55316d648918229f2b83fc5e7cf.tar.bz2 |
Don't use the if(foo) free(foo); construct, as free(NULL); is well defined.
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/input_cdda.c | 32 | ||||
-rw-r--r-- | src/input/input_http.c | 3 | ||||
-rw-r--r-- | src/input/input_mms.c | 4 |
3 files changed, 12 insertions, 27 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 621aff14a..eedd0d80e 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -383,10 +383,10 @@ static cdrom_toc * init_cdrom_toc(void) { static void free_cdrom_toc(cdrom_toc *toc) { - if(toc && toc->toc_entries) + if ( toc ) { free(toc->toc_entries); - if (toc) - free (toc); + free(toc); + } } #if defined (__linux__) @@ -1985,26 +1985,15 @@ static void _cdda_free_cddb_info(cdda_input_plugin_t *this) { int t; for(t = 0; t < this->cddb.num_tracks; t++) { - if(this->cddb.track[t].title) - free(this->cddb.track[t].title); + free(this->cddb.track[t].title); } free(this->cddb.track); - - if(this->cddb.cdiscid) - free(this->cddb.cdiscid); - - if(this->cddb.disc_title) - free(this->cddb.disc_title); - - if(this->cddb.disc_artist) - free(this->cddb.disc_artist); - - if(this->cddb.disc_category) - free(this->cddb.disc_category); - - if(this->cddb.disc_year) - free(this->cddb.disc_year); + free(this->cddb.cdiscid); + free(this->cddb.disc_title); + free(this->cddb.disc_artist); + free(this->cddb.disc_category); + free(this->cddb.disc_year); } } @@ -2354,8 +2343,7 @@ static void cdda_plugin_dispose (input_plugin_t *this_gen ) { free(this->mrl); - if (this->cdda_device) - free(this->cdda_device); + free(this->cdda_device); if (this->class) { cdda_input_class_t *inp = (cdda_input_class_t *) this->class; inp->ip = NULL; diff --git a/src/input/input_http.c b/src/input/input_http.c index 328ab523e..5975bb64b 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -1076,8 +1076,7 @@ static const char *http_class_get_identifier (input_class_t *this_gen) { static void http_class_dispose (input_class_t *this_gen) { http_input_class_t *this = (http_input_class_t *) this_gen; - if(this->proxyhost_env) - free(this->proxyhost_env); + free(this->proxyhost_env); free (this); } diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 3e4b7172c..0b726fef0 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -285,9 +285,7 @@ static void mms_plugin_dispose (input_plugin_t *this_gen) { this->nbc = NULL; } - if(this->mrl) - free(this->mrl); - + free(this->mrl); free (this); } |