forked from osmocom/wireshark
text2pcap: fix crash when there is no argument
Bug: 14082 Change-Id: Ifd8b2bf9bee817967e3b00e01b8b4ae90970e984 Reviewed-on: https://code.wireshark.org/review/23727 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
f649064130
commit
33c00a6741
13
text2pcap.c
13
text2pcap.c
|
@ -1881,7 +1881,10 @@ main(int argc, char *argv[])
|
|||
{
|
||||
int ret = EXIT_SUCCESS;
|
||||
|
||||
parse_options(argc, argv);
|
||||
if (parse_options(argc, argv) != EXIT_SUCCESS) {
|
||||
ret = EXIT_FAILURE;
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
assert(input_file != NULL);
|
||||
assert(output_file != NULL);
|
||||
|
@ -1933,8 +1936,12 @@ main(int argc, char *argv[])
|
|||
}
|
||||
clean_exit:
|
||||
text2pcap_lex_destroy();
|
||||
fclose(input_file);
|
||||
fclose(output_file);
|
||||
if (input_file) {
|
||||
fclose(input_file);
|
||||
}
|
||||
if (output_file) {
|
||||
fclose(output_file);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue