diff options
author | Michael Tuexen <tuexen@wireshark.org> | 2021-06-21 16:56:58 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-06-23 04:38:27 +0000 |
commit | 1f0a16e4724ebe57efa3af8ae74b94e8d4198641 (patch) | |
tree | 454328f67dea5b666b2106fe21ab7868e9dabead /wiretap/wtap.c | |
parent | c9f4bbc11cfcd12839721eeb92a17fad894493e1 (diff) |
pcapng: add support for custom options
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r-- | wiretap/wtap.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c index a0bc68e0fb..51e1e7547a 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1664,6 +1664,9 @@ wtap_rec_init(wtap_rec *rec) void wtap_rec_cleanup(wtap_rec *rec) { + wtap_option_t option; + guint i; + g_free(rec->opt_comment); rec->opt_comment = NULL; ws_buffer_free(&rec->options_buf); @@ -1671,6 +1674,15 @@ wtap_rec_cleanup(wtap_rec *rec) g_ptr_array_free(rec->packet_verdict, TRUE); rec->packet_verdict = NULL; } + if (rec->custom_options != NULL) { + for (i = 0; i < rec->custom_options->len; i++) { + option = g_array_index(rec->custom_options, wtap_option_t, i); + g_free(option.value.custom_opt.custom_data); + option.value.custom_opt.custom_data = NULL; + } + g_array_free(rec->custom_options, TRUE); + rec->custom_options = NULL; + } } gboolean |