[Xorp-hackers] _xdebug_preamble memory leak??

Pavlin Radoslavov pavlin@icir.org
Wed, 26 Nov 2003 22:20:35 -0800


> Hi All,
>   I have a question, during porting I find _xdebug_preamble malloc the preamble buf, 
> but _xdebug_msg_va not free it after using it.
>   Am I missing something?

Edrt,

If the buffer you have in mind is sbuf, please note that it is
defined as "static" inside _xdebug_preamble(). Hence, the first time
_xdebug_preamble() is called, sbuf is allocated. Then, the next time
_xdebug_preamble() is called, the previous value of sbuf will be
used, and malloc() won't be called.
In other words, I believe the code is fine and there is no memory leak.

Regards,
Pavlin