diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-09-10 17:54:16 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-09-10 18:26:16 +0000 |
commit | 6bcf405338d498c76005223190a591048922f18d (patch) | |
tree | 0fbff1b0199c180c68d723dbc9f34cb971d9cdff | |
parent | 1a89b51e413f164d4a25d44d8c61beea8498a09a (diff) |
Thread: replace g_strsplit by wmem_strsplit
It avoids leaking memory in case an exception is thrown during
dissection
Change-Id: Ib25c6a82b90ca541db121a79515a087d8d2c332f
Reviewed-on: https://code.wireshark.org/review/23468
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-thread.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dissectors/packet-thread.c b/epan/dissectors/packet-thread.c index 4b5a8abaa8..2674993bd4 100644 --- a/epan/dissectors/packet-thread.c +++ b/epan/dissectors/packet-thread.c @@ -2124,12 +2124,11 @@ dissect_thread_coap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d coinfo = (coap_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_coap, 0); uri = (gchar *)wmem_strbuf_get_str(coinfo->uri_str_strbuf); - tokens = g_strsplit(uri, "/", 3); + tokens = wmem_strsplit(wmem_packet_scope(), uri, "/", 3); if ((tokens[0] != NULL) && (tokens[1] != NULL)) { /* No need to create a subset as we are dissecting the tvb as it is */ dissector_try_string(thread_coap_namespace, tokens[1], tvb, pinfo, tree, NULL); } - g_strfreev(tokens); return tvb_captured_length(tvb); } |