From d2727ec8a2bc0524e6e1ea5a1992bed153b1488c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 20 Jul 2016 19:53:33 -0700 Subject: Don't pass NULL to wtap_block_set_string_option_value(). To remove OPT_SHB_HARDWARE, use wtap_block_remove_option(). To get the string value from a GString, use g_string_free(string, FALSE), not g_string_free(string, TRUE) - the latter will free the string value and return NULL. Change-Id: I0c5a9f818543f6752f455f04fb3c024208e23954 Reviewed-on: https://code.wireshark.org/review/16567 Reviewed-by: Guy Harris --- wiretap/merge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'wiretap/merge.c') diff --git a/wiretap/merge.c b/wiretap/merge.c index 85cc1d9d51..89887ffee6 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -410,11 +410,9 @@ create_shb_header(const merge_in_file_t *in_files, const guint in_file_count, * XXX - and how do we preserve all the OPT_SHB_HARDWARE, OPT_SHB_OS, * and OPT_SHB_USERAPPL values from all the previous files? */ - wtap_block_set_string_option_value(shb_hdr, OPT_SHB_HARDWARE, NULL, 0 ); /* NULL if not available, UTF-8 string containing the */ - /* description of the hardware used to create this section. */ - + wtap_block_remove_option(shb_hdr, OPT_SHB_HARDWARE); opt_len = os_info_str->len; - wtap_block_set_string_option_value(shb_hdr, OPT_SHB_OS, g_string_free(os_info_str, TRUE), opt_len); /* UTF-8 string containing the name */ + wtap_block_set_string_option_value(shb_hdr, OPT_SHB_OS, g_string_free(os_info_str, FALSE), opt_len); /* UTF-8 string containing the name */ /* of the operating system used to create this section. */ wtap_block_set_string_option_value(shb_hdr, OPT_SHB_USERAPPL, (char*)app_name, app_name ? strlen(app_name): 0 ); /* NULL if not available, UTF-8 string containing the name */ /* of the application used to create this section. */ -- cgit v1.2.3