summaryrefslogtreecommitdiff
path: root/util-linux/getopt.c
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/getopt.c
parent1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff)
downloadbusybox-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/getopt.c')
-rw-r--r--util-linux/getopt.c9
1 files changed, 3 insertions, 6 deletions
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':