diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-09-10 17:52:14 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-09-10 18:25:27 +0000 |
commit | 1a89b51e413f164d4a25d44d8c61beea8498a09a (patch) | |
tree | 1494c354281a7e2f5646a5d5ec9b0e5f501e02fe /epan/dissectors/packet-rtpproxy.c | |
parent | 350676f2723e1898e689d3026b62a8ea26409f4f (diff) |
RTPproxy: replace g_strsplit by wmem_strsplit
It avoids leaking memory in case an exception is thrown during
dissection
Change-Id: Ic1ce27800e699b01492f1d40ce720fc82416cfbc
Reviewed-on: https://code.wireshark.org/review/23467
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-rtpproxy.c')
-rw-r--r-- | epan/dissectors/packet-rtpproxy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c index e1352059b5..fad315cd21 100644 --- a/epan/dissectors/packet-rtpproxy.c +++ b/epan/dissectors/packet-rtpproxy.c @@ -349,7 +349,7 @@ rtpproxy_add_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_t case 'c': new_offset = (gint)strspn(rawstr+offset, "0123456789,"); another_tree = proto_item_add_subtree(ti, ett_rtpproxy_command_parameters_codecs); - codecs = g_strsplit(tvb_get_string_enc(wmem_packet_scope(), tvb, begin+offset, new_offset, ENC_ASCII), ",", 0); + codecs = wmem_strsplit(wmem_packet_scope(), tvb_get_string_enc(wmem_packet_scope(), tvb, begin+offset, new_offset, ENC_ASCII), ",", 0); i = 0; while(codecs[i]){ /* We assume strings < 2^32-1 bytes long. :-) */ @@ -362,7 +362,6 @@ rtpproxy_add_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtpproxy_t offset++; /* skip comma */ i++; }; - g_strfreev(codecs); break; case 'l': /* That's another one protocol shortcoming - the same parameter used twice. */ |