Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 44559: /trunk/epan/dissectors/ /trun
From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Mon, 20 Aug 2012 11:25:19 -0400
mmann@xxxxxxxxxxxxx wrote:
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=44559

User: mmann
Date: 2012/08/17 07:55 PM

Log:
 Use capture scoped memory for hash table functionality

Directory: /trunk/epan/dissectors/
  Changes    Path             Action
  +6 -58     packet-sctp.c    Modified

I had looked at doing something similar before but I discovered a good reason not to: now (with this change) the SCTP dissector will keep *2* copies of each fragment until the file is closed: once for each individual fragment and another one once the reassembly is done. IOW in this case there seemed to be a good reason for using g_malloc()'d memory: so we can free the (temporary) copies of the fragments once the reassembly is done (which should be well before the capture file is closed).

(That's not to say this method is the best; ideally we wouldn't have to do all this allocating + copying + freeing but I've never been inspired to try to solve that problem.)