aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-09-10 17:49:08 +0200
committerMichael Mann <mmann78@netscape.net>2017-09-10 18:11:42 +0000
commit124cf779f0c0d3a856a9c1793cb165eb56512705 (patch)
tree0e86427d53209f42d0a441d3c413b35054404c8d /epan/dissectors/packet-http.c
parent85d742ef26970e35d16f16a9bea04a12ff618e17 (diff)
HTTP: replace g_strsplit by wmem_strsplit
It avoids leaking memory in case an exception is thrown during dissection Change-Id: Ic63a8ad7923c81c7c7d7f0c471e304d8a5224212 Reviewed-on: https://code.wireshark.org/review/23465 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-http.c')
-rw-r--r--epan/dissectors/packet-http.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index ae788743f2..cc1778a43e 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2172,7 +2172,7 @@ http_payload_subdissector(tvbuff_t *tvb, proto_tree *tree,
addresses_equal(&conv_data->server_addr, &pinfo->src);
/* Grab the destination port number from the request URI to find the right subdissector */
- strings = g_strsplit(conv_data->request_uri, ":", 2);
+ strings = wmem_strsplit(wmem_packet_scope(), conv_data->request_uri, ":", 2);
if(strings[0] != NULL && strings[1] != NULL) {
/*
@@ -2234,7 +2234,6 @@ http_payload_subdissector(tvbuff_t *tvb, proto_tree *tree,
*ptr = saved_port;
}
}
- g_strfreev(strings); /* Free the result of g_strsplit() above */
}