Wireshark-commits: [Wireshark-commits] rev 29441: /trunk/epan/ /trunk/epan/: exceptions.h tvbuff.c

Date: Sun, 16 Aug 2009 07:29:23 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=29441

User: krj
Date: 2009/08/16 12:29 AM

Log:
 Remove a non thread-safe usage (useful when/if we ever support threading) of a static tvbuff in tvb_new_real_data(). The current version uses a static 'last_tvb' to keep track of the last allocated tvbuff. This is needed because some of the function we call can throw an exception. This patch improves this strategy by throwing an exception (if needed) before we try to allocate the tvbuff. This way we avoid a memleak _and_ we don't have to track the 'last_tvb' tvbuff.

Directory: /trunk/epan/
  Changes    Path            Action
  +5 -0      exceptions.h    Modified
  +14 -22    tvbuff.c        Modified