summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-19 17:48:11 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-19 17:48:11 +0000
commit725d85f0020569ac4f80b68b3f0f485cdde30739 (patch)
tree496772591cc608c5b8fe60df484fbfd7cbe04ded /epan
parentf756c9b2c4648478f32e02d88a1041d2960e6b72 (diff)
downloadwireshark-725d85f0020569ac4f80b68b3f0f485cdde30739.tar.gz
Fix leaks where ptvcursor_free() wasn't being called.
svn path=/trunk/; revision=54255
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-omapi.c4
-rw-r--r--epan/dissectors/packet-pgm.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/epan/dissectors/packet-omapi.c b/epan/dissectors/packet-omapi.c
index f1a80c9d9d..a0ce306948 100644
--- a/epan/dissectors/packet-omapi.c
+++ b/epan/dissectors/packet-omapi.c
@@ -120,6 +120,7 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_reported_length_remaining(tvb, 0) < 8)
{
/* Payload too small for OMAPI */
+ ptvcursor_free(cursor);
DISSECTOR_ASSERT_NOT_REACHED();
}
else if (tvb_reported_length_remaining(tvb, 0) < 24)
@@ -131,6 +132,7 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "Status message");
proto_item_append_text(ti, ", Status message");
+ ptvcursor_free(cursor);
return;
}
else if ( !(tvb_get_ntohl(tvb, 8) || tvb_get_ntohl(tvb, 12)) )
@@ -216,6 +218,8 @@ dissect_omapi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (authlength > 0) {
ptvcursor_add(cursor, hf_omapi_signature, authlength, ENC_NA);
}
+
+ ptvcursor_free(cursor);
}
void
diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c
index f0e0936c7e..63ba6247a7 100644
--- a/epan/dissectors/packet-pgm.c
+++ b/epan/dissectors/packet-pgm.c
@@ -974,6 +974,7 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
proto_tree_add_text(type_tree, tvb, ptvcursor_current_offset(cursor), -1,
"Can't handle this address format");
+ ptvcursor_free(cursor);
return;
}
break;
@@ -1027,6 +1028,7 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
proto_tree_add_text(type_tree, tvb, ptvcursor_current_offset(cursor), -1,
"Can't handle this address format");
+ ptvcursor_free(cursor);
return;
}
break;
@@ -1082,6 +1084,8 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (isdata)
decode_pgm_ports(tvb, ptvcursor_current_offset(cursor), pinfo, tree, pgmhdr_sport, pgmhdr_dport);
+
+ ptvcursor_free(cursor);
}
}