From 725d85f0020569ac4f80b68b3f0f485cdde30739 Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Thu, 19 Dec 2013 17:48:11 +0000 Subject: Fix leaks where ptvcursor_free() wasn't being called. svn path=/trunk/; revision=54255 --- epan/dissectors/packet-omapi.c | 4 ++++ epan/dissectors/packet-pgm.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'epan') 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); } } -- cgit v1.2.3