[Asterisk-Dev] Module Debugging; Leak Finding

Steve Kann stevek at stevek.com
Sat May 7 17:50:37 MST 2005


On May 7, 2005, at 8:19 PM, Matthew Boehm wrote:

> Hey guys,
>  I'm currently writing some custom modules for our billing system. The
> module deals with a few file open/close/create functions. I'm having to
> alloca char * strings every now and then because I'm not sure how much 
> I
> will need each time.
>  What tools can I use to detect any memory leaks, proper alloca'd 
> memory
> releases, etc..?
>


If you use alloca for allocating things, you don't have to "release" 
it; it's on the stack, and is "released" when your function returns.

>
>  I'd like to try to become a more responsible programmer and try and 
> deal
> with things like this on my own. But I don't know the first thing about
> memory leak detection etc..


valgrind would be the tool you're looking for.

-SteveK




More information about the asterisk-dev mailing list