From fab0e59c70bfd8e39189ac29b17333d85d4645cb Mon Sep 17 00:00:00 2001 From: Hadriel Kaplan Date: Thu, 20 Aug 2015 14:38:35 -0400 Subject: Fix memory leaks of dumper SHB and IDB infos Change-Id: I6b81d3e853d503c6a81f9793957b48ab34c6808c Reviewed-on: https://code.wireshark.org/review/10156 Petri-Dish: Hadriel Kaplan Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/gtk/file_import_dlg.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ui/gtk/file_import_dlg.c') diff --git a/ui/gtk/file_import_dlg.c b/ui/gtk/file_import_dlg.c index 06e3a5790b..4700fa5b0a 100644 --- a/ui/gtk/file_import_dlg.c +++ b/ui/gtk/file_import_dlg.c @@ -461,7 +461,6 @@ file_import_open(text_import_info_t *info) 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, "import"); @@ -471,8 +470,6 @@ file_import_open(text_import_info_t *info) 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_new(wtapng_section_t,1); shb_hdr->section_length = -1; /* options */ @@ -491,7 +488,7 @@ file_import_open(text_import_info_t *info) * 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 */ @@ -569,8 +566,8 @@ end: g_free(info->date_timestamp_format); g_free(info); g_free(capfile_name); - g_free(shb_hdr); - g_free(appname); + wtap_free_shb(shb_hdr); + wtap_free_idb_info(idb_inf); window_destroy(file_import_dlg_w); } -- cgit v1.2.1