[Asterisk-Dev] newbie C programmer, problems with Malloc in Asterisk application

Moises Silva moises.silva at gmail.com
Tue Dec 13 10:25:00 MST 2005


Thanks Marc. I have read about alloca(), malloc(), free() etc. And yes,in
fact im freeing the memory used by malloc with free(). So I dont know why it
dies (and even if i did not free the memory, should not die for a single
call does it?).

the whole file is in:
http://galileo.ivsol.net/scripts/app_dumpchan.c

Thanks In Advance.

On 12/13/05, Marc Haisenko <haisenko at comdasys.com> wrote:
>
> On Tuesday 13 December 2005 17:50, Moises Silva wrote:
> > the application just dies when the malloc() function is called. Any help
> > and suggestions will be appreciated.
>
> If you don't need the variable to survive your function call then you can
> try
> using alloca, which will allocate on your stack frame. Has the nice side
> effect that you don't need to free the memory, that happens as soons as
> you
> leave your function.
>
> C'ya,
>         Marc
>
> --
> Marc Haisenko
> Comdasys AG
>
> Rüdesheimer Straße 7
> D-80686 München
> Tel: +49 (0)89 - 548 43 33 0
> Fax: +49 (0)89 - 548 43 33 29
> e-mail: haisenko at comdasys.com
> http://www.comdasys.com
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20051213/d2e26482/attachment.htm


More information about the asterisk-dev mailing list