diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-12-13 02:56:44 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-12-13 02:56:44 +0000 |
commit | 199da73e21525ff6fd8eb2b177e35b5396e6275c (patch) | |
tree | 76369dff2572eec863c88bcdc62aa02cdcc5d4ae | |
parent | c3da1f23d3793b4eb8ddf23f75a29d124c34b085 (diff) |
Prevent memory leakage of uncompress tvb and associated data buffer (step 1).
(tvb memory leak will actually remain until a bug in tvbuff.c is also fixed).
svn path=/trunk/; revision=40171
-rw-r--r-- | epan/dissectors/packet-dmp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ipsec.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ldss.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-spice.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index 4e2b528f6e..06cacaa735 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -3196,7 +3196,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo, } else if (len > 0 && (dmp.body_format == FREE_TEXT || dmp.body_format == FREE_TEXT_SUBJECT)) { if (compr_alg == ALGORITHM_ZLIB) { - if ((next_tvb = tvb_uncompress (tvb, offset, len)) != NULL) { + if ((next_tvb = tvb_child_uncompress (tvb, tvb, offset, len)) != NULL) { gint zlen = tvb_length (next_tvb); add_new_data_source (pinfo, next_tvb, "Uncompressed User data"); tf = proto_tree_add_none_format (message_tree, diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 0d90c6e11e..7cd714b0b4 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -1966,7 +1966,7 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * CPIs, we don't know the algorithm beforehand; if we get it * wrong, tvb_uncompress() returns NULL and nothing is displayed. */ - decomp = tvb_uncompress(data, 0, tvb_length(data)); + decomp = tvb_child_uncompress(data, data, 0, tvb_length(data)); if (decomp) { add_new_data_source(pinfo, decomp, "IPcomp inflated data"); if (!dissector_try_uint(ip_dissector_table, ipcomp.comp_nxt, decomp, pinfo, tree)) diff --git a/epan/dissectors/packet-ldss.c b/epan/dissectors/packet-ldss.c index 3ba601688e..e36b138abc 100644 --- a/epan/dissectors/packet-ldss.c +++ b/epan/dissectors/packet-ldss.c @@ -703,7 +703,7 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Be nice and uncompress the file data. */ if (compression == COMPRESSION_GZIP) { tvbuff_t *uncomp_tvb = NULL; - uncomp_tvb = tvb_uncompress(tvb, 0, tvb_length(tvb)); + uncomp_tvb = tvb_child_uncompress(tvb, tvb, 0, tvb_length(tvb)); if (uncomp_tvb != NULL) { proto_tree_add_bytes_format_value(ldss_tree, hf_ldss_file_data, uncomp_tvb, 0, tvb_length(uncomp_tvb), diff --git a/epan/dissectors/packet-spice.c b/epan/dissectors/packet-spice.c index f03683da0e..3193832157 100644 --- a/epan/dissectors/packet-spice.c +++ b/epan/dissectors/packet-spice.c @@ -1391,7 +1391,7 @@ dissect_ImageZLIB_GLZ_stream(tvbuff_t *tvb, proto_tree *ZLIB_GLZ_tree, packet_in tvbuff_t *uncompressed_tvb; ti = proto_tree_add_text(ZLIB_GLZ_tree, tvb, offset, ZLIB_GLZSize, "ZLIB stream (%u bytes)", ZLIB_GLZSize); - uncompressed_tvb = tvb_uncompress(tvb, offset, ZLIB_GLZSize); + uncompressed_tvb = tvb_child_uncompress(tvb, tvb, offset, ZLIB_GLZSize); if (uncompressed_tvb != NULL) { add_new_data_source(pinfo, uncompressed_tvb, "Uncompressed GLZ stream"); Uncomp_tree = proto_item_add_subtree(ti, ett_Uncomp_tree); |