diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-07-20 19:53:33 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-21 02:54:03 +0000 |
commit | d2727ec8a2bc0524e6e1ea5a1992bed153b1488c (patch) | |
tree | 1fd465a787886569714e5b418b82f8cb7194fc37 | |
parent | 52323b20f5ca54d62d8fbffa4ddea8cc851c22df (diff) | |
download | wireshark-d2727ec8a2bc0524e6e1ea5a1992bed153b1488c.tar.gz wireshark-d2727ec8a2bc0524e6e1ea5a1992bed153b1488c.tar.bz2 wireshark-d2727ec8a2bc0524e6e1ea5a1992bed153b1488c.zip |
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 <guy@alum.mit.edu>
-rw-r--r-- | wiretap/merge.c | 6 |
1 files changed, 2 insertions, 4 deletions
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. */ |