From a170e1c858d35c474ceb9fecb41b37d681424094 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Thu, 28 Nov 2002 11:27:31 +0000 Subject: Change if(x)free(x); to free(x); --- util-linux/fsck_minix.c | 4 +--- util-linux/getopt.c | 9 +++------ util-linux/umount.c | 6 ++---- 3 files changed, 6 insertions(+), 13 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index dbe4f74..d332b6b 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -1314,9 +1314,7 @@ static void free_name_list(void) if (name_list) { for (i = 0; i < MAX_DEPTH; i++) { - if (name_list[i]) { - free(name_list[i]); - } + free(name_list[i]); } free(name_list); } diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 2390f30..e126d7b 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -92,8 +92,7 @@ const char *normalize(const char *arg) const char *argptr=arg; char *bufptr; - if (BUFFER != NULL) - free(BUFFER); + free(BUFFER); if (!quote) { /* Just copy arg */ BUFFER=xstrdup(arg); @@ -340,16 +339,14 @@ int getopt_main(int argc, char *argv[]) alternative=1; break; case 'o': - if (optstr) - free(optstr); + free(optstr); optstr=xstrdup(optarg); break; case 'l': add_long_options(optarg); break; case 'n': - if (name) - free(name); + free(name); name=xstrdup(optarg); break; case 'q': diff --git a/util-linux/umount.c b/util-linux/umount.c index 29e2e3b..391d245 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -158,10 +158,8 @@ static void mtab_free(void) this = mtab_cache; while (this) { next = this->next; - if (this->device) - free(this->device); - if (this->mountpt) - free(this->mountpt); + free(this->device); + free(this->mountpt); free(this); this = next; } -- cgit v1.1