Skip to content

Commit 8d9ccd9

Browse files
committed
Don't destroy options before exit
There is no need to clean up when we exit, lets keep the code simpler. Signed-off-by: Nir Soffer <[email protected]>
1 parent 9fbceb3 commit 8d9ccd9

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

cli.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,11 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
143143
break;
144144
case 'h':
145145
print_usage(argv[0]);
146-
cli_options_destroy(res);
147146
exit(EXIT_SUCCESS);
148147
return NULL;
149148
break;
150149
case 'v':
151150
print_version();
152-
cli_options_destroy(res);
153151
exit(EXIT_SUCCESS);
154152
return NULL;
155153
break;
@@ -233,9 +231,7 @@ struct cli_options *cli_options_parse(int argc, char *argv[]) {
233231
return res;
234232
error:
235233
print_usage(argv[0]);
236-
cli_options_destroy(res);
237234
exit(EXIT_FAILURE);
238-
return NULL;
239235
}
240236

241237
void cli_options_destroy(struct cli_options *x) {

0 commit comments

Comments
 (0)