[asterisk-dev] ast_frame allocation/free question

Sergio Garcia Murillo sergio.garcia at fontventa.com
Tue Nov 27 05:00:16 CST 2007


Hi everyone,

I've been trying to fix some memory leaks in my applications related 
to frame allocation problems.
If I malloc a frame in an application and set the mallocd to AST_MALLOCD_HDR
it seems that ast_frfree is not called nowhere after writing it with ast_write.

I have checked and ast_write don't call ast_frfree for the input frame. In
case of a video frame just calls  chan->tech->write(chan, fr) but in rtp.c it's 
not freed also.

I've solved the problem in some cases making the frame static and in oder cases
setting mallocd to 0 and freeing it withing the application after using it.

Is this behavior correct? Shouldn't ast_write call ast_frfree?

Best regards
Sergio

 



More information about the asterisk-dev mailing list