Ethereal-dev: RE: [Ethereal-dev] Wicked bug

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Sat, 20 Dec 2003 00:16:52 +0100
| -----Original Message-----
| From: Guy Harris
| 
| On Dec 19, 2003, at 1:34 PM, Biot Olivier wrote:
| 
| > BTW what do CLEANUP_PUSH(g_free, strval) and 
| CLEANUP_CALL_AND_POP do?
| 
| The first of those pushes onto a stack of "cleanup" routines an entry 
| that says "if an exception is thrown, call 'g_free()' with 
| 'strval' as 
| an argument".  The second of those pops that entry off the stack and 
| makes the call in question.
| 
| I.e., the first one arranges that, even if the second 
| "get_text_string()" call throws an exception because the string runs 
| past the end of the tvbuff, "strval" will be freed.  The second one 
| cleans the entry for that off the stack, and frees "strval".

I see. Maybe I should foresee this in the WSP dissector too...