diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-08-19 14:55:41 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-08-19 14:55:41 +0000 |
commit | b46f9bebe29e215e0b84242771a92f1bbe6fdb38 (patch) | |
tree | 45c8664141827cb3018c2c7b2407fb906e4dad53 /epan/dissectors/packet-iwarp-mpa.c | |
parent | 02cae558f997dba1fd17011cc84e317f17d17a4d (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-iwarp-mpa.c')
-rw-r--r-- | epan/dissectors/packet-iwarp-mpa.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c index fbc1ef116e..7a3e01a449 100644 --- a/epan/dissectors/packet-iwarp-mpa.c +++ b/epan/dissectors/packet-iwarp-mpa.c @@ -311,7 +311,7 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset, /* allocate memory for the marker-free buffer */ mfree_buff_length = orig_length - (MPA_MARKER_LEN * num_markers); - mfree_buff = (guint8 *)g_malloc(mfree_buff_length); + mfree_buff = (guint8 *)wmem_alloc(pinfo->pool, mfree_buff_length); tot_copy = 0; source_offset = 0; @@ -324,7 +324,6 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset, } mfree_tvb = tvb_new_child_real_data(tvb, mfree_buff, mfree_buff_length, mfree_buff_length); - tvb_set_free_cb(mfree_tvb, g_free); add_new_data_source(pinfo, mfree_tvb, "FPDU without Markers"); return mfree_tvb; |