aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sdp.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-08-19 14:55:41 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-08-19 14:55:41 +0000
commitb46f9bebe29e215e0b84242771a92f1bbe6fdb38 (patch)
tree45c8664141827cb3018c2c7b2407fb906e4dad53 /epan/dissectors/packet-sdp.c
parent02cae558f997dba1fd17011cc84e317f17d17a4d (diff)
Change some dissectors to use pinfo memory pool instead of malloc if it can trigger an exception between between buffer allocation and tvb_set_free_cb call
svn path=/trunk/; revision=51427
Diffstat (limited to 'epan/dissectors/packet-sdp.c')
-rw-r--r--epan/dissectors/packet-sdp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index e4670a4cbb..e4676d448c 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -54,6 +54,7 @@
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/base64.h>
#include <epan/asn1.h>
#include <epan/prefs.h>
@@ -803,7 +804,7 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
static tvbuff_t *
ascii_bytes_to_tvb(tvbuff_t *tvb, packet_info *pinfo, gint len, gchar *msg)
{
- guint8 *buf = (guint8 *)g_malloc(10240);
+ guint8 *buf = (guint8 *)wmem_alloc(pinfo->pool, 10240);
/* arbitrary maximum length */
if (len < 20480) {
@@ -868,7 +869,6 @@ ascii_bytes_to_tvb(tvbuff_t *tvb, packet_info *pinfo, gint len, gchar *msg)
return NULL;
}
bytes_tvb = tvb_new_child_real_data(tvb, buf, i, i);
- tvb_set_free_cb(bytes_tvb, g_free);
add_new_data_source(pinfo, bytes_tvb, "ASCII bytes to tvb");
return bytes_tvb;
}