summaryrefslogtreecommitdiff
path: root/ui/tap_export_pdu.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-08-20 14:38:35 -0400
committerAnders Broman <a.broman58@gmail.com>2015-08-21 04:55:20 +0000
commitfab0e59c70bfd8e39189ac29b17333d85d4645cb (patch)
tree70ebe57fc81481ca1ead1df4067bf547262b4935 /ui/tap_export_pdu.c
parentb4762a043458e5205090282a099184980fb555ea (diff)
downloadwireshark-fab0e59c70bfd8e39189ac29b17333d85d4645cb.tar.gz
Fix memory leaks of dumper SHB and IDB infos
Change-Id: I6b81d3e853d503c6a81f9793957b48ab34c6808c Reviewed-on: https://code.wireshark.org/review/10156 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/tap_export_pdu.c')
-rw-r--r--ui/tap_export_pdu.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c
index f62373289a..f1dcacc63c 100644
--- a/ui/tap_export_pdu.c
+++ b/ui/tap_export_pdu.c
@@ -107,7 +107,6 @@ exp_pdu_file_open(exp_pdu_t *exp_pdu_tap_data)
wtapng_iface_descriptions_t *idb_inf;
wtapng_if_descr_t int_data;
GString *os_info_str;
- char *appname;
/* Choose a random name for the temporary import buffer */
import_file_fd = create_tempfile(&tmpname, "Wireshark_PDU_");
@@ -117,8 +116,6 @@ exp_pdu_file_open(exp_pdu_t *exp_pdu_tap_data)
os_info_str = g_string_new("");
get_os_version_info(os_info_str);
- appname = g_strdup_printf("Wireshark %s", get_ws_vcs_version_info());
-
shb_hdr = g_new0(wtapng_section_t,1);
shb_hdr->section_length = -1;
/* options */
@@ -137,7 +134,7 @@ exp_pdu_file_open(exp_pdu_t *exp_pdu_tap_data)
* UTF-8 string containing the name of the application used to create
* this section.
*/
- shb_hdr->shb_user_appl = appname;
+ shb_hdr->shb_user_appl = g_strdup_printf("Wireshark %s", get_ws_vcs_version_info());
/* Create fake IDB info */
idb_inf = g_new(wtapng_iface_descriptions_t,1);
@@ -206,8 +203,8 @@ exp_pdu_file_open(exp_pdu_t *exp_pdu_tap_data)
end:
g_free(capfile_name);
- g_free(shb_hdr);
- g_free(appname);
+ wtap_free_shb(shb_hdr);
+ wtap_free_idb_info(idb_inf);
}
gboolean