diff options
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/file_import_dlg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/gtk/file_import_dlg.c b/ui/gtk/file_import_dlg.c index dc6a97a4f5..09e319126a 100644 --- a/ui/gtk/file_import_dlg.c +++ b/ui/gtk/file_import_dlg.c @@ -465,6 +465,7 @@ file_import_open(text_import_info_t *info) wtapng_if_descr_mandatory_t *int_data_mand; GString *os_info_str; gsize opt_len; + gchar *opt_str; /* Create data for SHB */ os_info_str = g_string_new(""); @@ -480,7 +481,11 @@ file_import_open(text_import_info_t *info) * this section. */ opt_len = os_info_str->len; - wtap_block_add_string_option(shb_hdr, OPT_SHB_OS, g_string_free(os_info_str, TRUE), opt_len); + opt_str = g_string_free(os_info_str, FALSE); + if (opt_str) { + wtap_block_add_string_option(shb_hdr, OPT_SHB_OS, opt_str, opt_len); + g_free(opt_str); + } /* * UTF-8 string containing the name of the application used to create * this section. |