[Xorp-hackers] _xdebug_preamble memory leak??

edrt edrt@citiz.net
Thu, 27 Nov 2003 14:36:46 +0800


Yes, I miss the static keyword before sbuf, the code is ok.
Thanks.

Edrt 

>> 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
>_______________________________________________
>Xorp-hackers mailing list
>Xorp-hackers@icir.org
>http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers