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
This commit is contained in:
parent
c3da1f23d3
commit
199da73e21
|
@ -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,
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue