diff options
author | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
---|---|---|
committer | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
commit | a170e1c858d35c474ceb9fecb41b37d681424094 (patch) | |
tree | cda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /util-linux | |
parent | 1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff) | |
download | busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.gz busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.bz2 busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.zip |
Change if(x)free(x); to free(x);
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 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) | |||
1314 | 1314 | ||
1315 | if (name_list) { | 1315 | if (name_list) { |
1316 | for (i = 0; i < MAX_DEPTH; i++) { | 1316 | for (i = 0; i < MAX_DEPTH; i++) { |
1317 | if (name_list[i]) { | 1317 | free(name_list[i]); |
1318 | free(name_list[i]); | ||
1319 | } | ||
1320 | } | 1318 | } |
1321 | free(name_list); | 1319 | free(name_list); |
1322 | } | 1320 | } |
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) | |||
92 | const char *argptr=arg; | 92 | const char *argptr=arg; |
93 | char *bufptr; | 93 | char *bufptr; |
94 | 94 | ||
95 | if (BUFFER != NULL) | 95 | free(BUFFER); |
96 | free(BUFFER); | ||
97 | 96 | ||
98 | if (!quote) { /* Just copy arg */ | 97 | if (!quote) { /* Just copy arg */ |
99 | BUFFER=xstrdup(arg); | 98 | BUFFER=xstrdup(arg); |
@@ -340,16 +339,14 @@ int getopt_main(int argc, char *argv[]) | |||
340 | alternative=1; | 339 | alternative=1; |
341 | break; | 340 | break; |
342 | case 'o': | 341 | case 'o': |
343 | if (optstr) | 342 | free(optstr); |
344 | free(optstr); | ||
345 | optstr=xstrdup(optarg); | 343 | optstr=xstrdup(optarg); |
346 | break; | 344 | break; |
347 | case 'l': | 345 | case 'l': |
348 | add_long_options(optarg); | 346 | add_long_options(optarg); |
349 | break; | 347 | break; |
350 | case 'n': | 348 | case 'n': |
351 | if (name) | 349 | free(name); |
352 | free(name); | ||
353 | name=xstrdup(optarg); | 350 | name=xstrdup(optarg); |
354 | break; | 351 | break; |
355 | case 'q': | 352 | 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) | |||
158 | this = mtab_cache; | 158 | this = mtab_cache; |
159 | while (this) { | 159 | while (this) { |
160 | next = this->next; | 160 | next = this->next; |
161 | if (this->device) | 161 | free(this->device); |
162 | free(this->device); | 162 | free(this->mountpt); |
163 | if (this->mountpt) | ||
164 | free(this->mountpt); | ||
165 | free(this); | 163 | free(this); |
166 | this = next; | 164 | this = next; |
167 | } | 165 | } |