aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorAaron Lehmann <aaronl@vitelius.com>2002-11-28 11:27:31 +0000
committerAaron Lehmann <aaronl@vitelius.com>2002-11-28 11:27:31 +0000
commita170e1c858d35c474ceb9fecb41b37d681424094 (patch)
treecda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /util-linux
parent1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff)
downloadbusybox-a170e1c858d35c474ceb9fecb41b37d681424094.tar.gz
Change if(x)free(x); to free(x);
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fsck_minix.c4
-rw-r--r--util-linux/getopt.c9
-rw-r--r--util-linux/umount.c6
3 files changed, 6 insertions, 13 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index dbe4f74b3..d332b6b0a 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 2390f3056..e126d7b6e 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 29e2e3b66..391d245a8 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;
}