diff options
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fsck_minix.c | 4 | ||||
-rw-r--r-- | util-linux/getopt.c | 9 | ||||
-rw-r--r-- | util-linux/umount.c | 6 |
3 files changed, 6 insertions, 13 deletions
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; } |