diff options
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -2877,10 +2877,10 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type, nrb_hdrs = wtap_file_get_nrb_for_new_file(cf->wth); /* If we don't have an application name add Tshark */ - wtap_optionblock_get_option_string(g_array_index(shb_hdrs, wtap_optionblock_t, 0), OPT_SHB_USERAPPL, &shb_user_appl); - if (shb_user_appl == NULL) { - /* this is free'd by wtap_optionblock_free() later */ - wtap_optionblock_set_option_string_format(g_array_index(shb_hdrs, wtap_optionblock_t, 0), OPT_SHB_USERAPPL, "TShark (Wireshark) %s", get_ws_vcs_version_info()); + if (wtap_block_get_string_option_value(g_array_index(shb_hdrs, wtap_block_t, 0), OPT_SHB_USERAPPL, &shb_user_appl) != WTAP_OPTTYPE_SUCCESS || + shb_user_appl == NULL) { + /* this is free'd by wtap_block_free() later */ + wtap_block_add_string_option_format(g_array_index(shb_hdrs, wtap_block_t, 0), OPT_SHB_USERAPPL, "TShark (Wireshark) %s", get_ws_vcs_version_info()); } if (linktype != WTAP_ENCAP_PER_PACKET && @@ -3121,8 +3121,8 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type, break; } wtap_dump_close(pdh, &err); - wtap_optionblock_array_free(shb_hdrs); - wtap_optionblock_array_free(nrb_hdrs); + wtap_block_array_free(shb_hdrs); + wtap_block_array_free(nrb_hdrs); exit(2); } } @@ -3236,8 +3236,8 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type, break; } wtap_dump_close(pdh, &err); - wtap_optionblock_array_free(shb_hdrs); - wtap_optionblock_array_free(nrb_hdrs); + wtap_block_array_free(shb_hdrs); + wtap_block_array_free(nrb_hdrs); exit(2); } } @@ -3353,8 +3353,8 @@ out: cf->wth = NULL; g_free(save_file_string); - wtap_optionblock_array_free(shb_hdrs); - wtap_optionblock_array_free(nrb_hdrs); + wtap_block_array_free(shb_hdrs); + wtap_block_array_free(nrb_hdrs); return err; } |