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-iscsi.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-iscsi.c')
-rw-r--r-- | epan/dissectors/packet-iscsi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index c38b9432e0..96cc949715 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -45,6 +45,7 @@ #include <epan/conversation.h> #include "packet-scsi.h" #include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/range.h> #include <wsutil/crc32.h> @@ -1592,7 +1593,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off /* We have a variable length CDB where bytes >16 is transported * in the AHS. */ - cdb_buf=(guint8 *)g_malloc(16+ahs_cdb_length); + cdb_buf=(guint8 *)wmem_alloc(pinfo->pool, 16+ahs_cdb_length); /* the 16 first bytes of the cdb */ tvb_memcpy(tvb, cdb_buf, cdb_offset, 16); /* the remainder of the cdb from the ahs */ @@ -1601,7 +1602,6 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off cdb_tvb = tvb_new_child_real_data(tvb, cdb_buf, ahs_cdb_length+16, ahs_cdb_length+16); - tvb_set_free_cb(cdb_tvb, g_free); add_new_data_source(pinfo, cdb_tvb, "CDB+AHS"); } else { |