aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/h245
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2006-01-12 21:53:02 +0000
committerGerald Combs <gerald@wireshark.org>2006-01-12 21:53:02 +0000
commit62a3709da359b1a26a8dbe221f8666c60a1311b7 (patch)
treec81937a3e670a6f71597e49429412e9ddb16f6d3 /asn1/h245
parente3e5ea61c22df8cad1ad915374e2fe361a61ee74 (diff)
Reset h245_pi using CLEANUP_PUSH/CLEANUP_CALL_AND_POP so that we don't leave
ep_alloc()ated memory lying around. Fixes bug 667. Fixup whitespace. svn path=/trunk/; revision=17022
Diffstat (limited to 'asn1/h245')
-rw-r--r--asn1/h245/packet-h245-template.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/asn1/h245/packet-h245-template.c b/asn1/h245/packet-h245-template.c
index 3ac99da2fa..c8f29afe94 100644
--- a/asn1/h245/packet-h245-template.c
+++ b/asn1/h245/packet-h245-template.c
@@ -290,6 +290,11 @@ dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
dissect_tpkt_encap(tvb, pinfo, parent_tree, h245_reassembly, MultimediaSystemControlMessage_handle);
}
+static void reset_h245_pi(void *dummy _U_)
+{
+ h245_pi = NULL; /* Make sure we don't leave ep_alloc()ated memory lying around */
+}
+
static void
dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
@@ -306,11 +311,12 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* assume that whilst there is more tvb data, there are more h245 commands */
while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
+ CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=ep_alloc(sizeof(h245_packet_info));
offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, pinfo ,tr, hf_h245_pdu_type);
tap_queue_packet(h245dg_tap, pinfo, h245_pi);
offset = (offset+0x07) & 0xfffffff8;
- h245_pi = NULL;
+ CLEANUP_CALL_AND_POP;
}
}
@@ -354,7 +360,7 @@ void proto_register_h245(void) {
proto_register_subtree_array(ett, array_length(ett));
/* From Ronnie Sahlbergs original H245 dissector */
-
+
h245_module = prefs_register_protocol(proto_h245, NULL);
prefs_register_bool_preference(h245_module, "reassembly",
"Reassemble H.245 messages spanning multiple TCP segments",