diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-10-27 23:41:51 +0200 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-10-27 21:50:18 +0000 |
commit | 1fae14257a8a7ade813930097a12dd3e555a9f76 (patch) | |
tree | ea11c716166e6193e9d04f972f619338939e1f0a /wiretap | |
parent | 7dfaab3cf79db1f36d4607d5d1ce79c222b8a9ac (diff) |
merge.c: do not give a NULL pointer when saving SHB comment option
Bug: 13060
Change-Id: Ib3dd019f73305e4006b312d324502e4a138c6a16
Reviewed-on: https://code.wireshark.org/review/18514
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/merge.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c index 5b771d981e..38ceed29d5 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -406,7 +406,9 @@ create_shb_header(const merge_in_file_t *in_files, const guint in_file_count, shb_data->section_length = -1; /* TODO: handle comments from each file being merged */ opt_len = comment_gstr->len; - wtap_block_set_nth_string_option_value(shb_hdr, OPT_COMMENT, 0, g_string_free(comment_gstr, TRUE), opt_len); /* section comment */ + opt_str = g_string_free(comment_gstr, FALSE); + wtap_block_set_nth_string_option_value(shb_hdr, OPT_COMMENT, 0, opt_str, opt_len); /* section comment */ + g_free(opt_str); /* * XXX - and how do we preserve all the OPT_SHB_HARDWARE, OPT_SHB_OS, * and OPT_SHB_USERAPPL values from all the previous files? |