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

Moises Silva moises.silva at gmail.com
Wed Dec 14 08:00:15 MST 2005


Thanks for the pointing Chih. The fact is that i was expecting, perhaps,
suggestions or corrections about how to implement what im trying to do in
Asterisk, not only "free and easy training for a newbie". Anyway, thanks
again, the next time I will think better if the question is worth to be
posted here.

regards

On 12/13/05, Chih-Wei Huang <cwhuang at citron.com.tw> wrote:
>
> Moises Silva wrote:
> > 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
> >
>
> First, this is a list for Asterisk development, not for
> a C language training for a newbie.
> Your problem didn't related to any development of Asterisk.
> You just misused the realloc function:
>
> vars_buffer = (char *)realloc(vars_buffer, new_string_size);
>
> The pointer passed to realloc must be a pointer returned by
> malloc/calloc/realloc. You can't use it to adjust a static buffer.
> _______________________________________________
> --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/20051214/6e7f1802/attachment.htm


More information about the asterisk-dev mailing list