diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-01-20 09:44:29 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-01-20 09:44:29 +0000 |
commit | b6f063232337d5e1de54f818122e484b532b9fb5 (patch) | |
tree | fb83c3184a02cf149c2b777a5e3616fd85363ede /epan/dissectors | |
parent | 3060dc91b647956ed4c3031546328fe405ebc765 (diff) |
Free the chunk of reassembled DNP data iff there was a CRC error;
otherwise, we're using it in a tvbuff and shouldn't free it (even if the
next level of reassembly isn't complete, so that al_tvb is ultimately
null).
svn path=/trunk/; revision=13134
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-dnp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 02239ad0ca..1c69ff1f35 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -624,11 +624,13 @@ dissect_dnp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) add_new_data_source(pinfo, al_tvb, "DNP 3.0 Application Layer message"); } } - else if (tree) + else { + /* CRC error - throw away the data. */ + g_free(tmp); + if (tree) proto_tree_add_text(dnp3_tree, tvb, 11, -1, - "Application tvb allocation failed %d chunks", i); - - if (!al_tvb && tmp) g_free(tmp); + "CRC failed, %d chunks", i); + } if (al_tvb) dissect_dnp3_al(al_tvb, pinfo, dnp3_tree); |