aboutsummaryrefslogtreecommitdiff
path: root/util-linux/getopt.c
diff options
context:
space:
mode:
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':