Skip to content

Commit

Permalink
free
Browse files Browse the repository at this point in the history
  • Loading branch information
tsjensen committed Nov 9, 2023
1 parent 30c4899 commit a194164
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,14 @@ opt_t *process_commandline(int argc, char *argv[])

case 'a':
if (alignment(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;

case 'c':
if (command_line_design(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;
Expand All @@ -692,12 +694,14 @@ opt_t *process_commandline(int argc, char *argv[])

case 'd':
if (design_choice(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;

case 'e':
if (eol_override(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;
Expand All @@ -712,12 +716,14 @@ opt_t *process_commandline(int argc, char *argv[])

case 'i':
if (indentation_mode(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;

case 'k':
if (killblank(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;
Expand Down Expand Up @@ -748,18 +754,21 @@ opt_t *process_commandline(int argc, char *argv[])
result->encoding = strdup(optarg); /* character encoding */
if (result->encoding == NULL) {
perror(PROJECT);
BFREE(result);
return NULL;
}
break;

case 'p':
if (padding(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;

case 'q':
if (query(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;
Expand All @@ -770,12 +779,14 @@ opt_t *process_commandline(int argc, char *argv[])

case 's':
if (size_of_box(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;

case 't':
if (tab_handling(result, optarg) != 0) {
BFREE(result);
return NULL;
}
break;
Expand All @@ -788,6 +799,7 @@ opt_t *process_commandline(int argc, char *argv[])
case '?':
/* Missing argument or illegal option - do nothing else */
usage_short(stderr);
BFREE(result);
return NULL;

case EOF:
Expand All @@ -796,11 +808,13 @@ opt_t *process_commandline(int argc, char *argv[])

default:
bx_fprintf(stderr, "%s: internal error\n", PROJECT);
BFREE(result);
return NULL;
}
} while (oc != EOF);

if (input_output_files(result, argv, optind) != 0) {
BFREE(result);
return NULL;
}

Expand Down

0 comments on commit a194164

Please sign in to comment.