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

Marc Haisenko haisenko at comdasys.com
Tue Dec 13 10:02:52 MST 2005


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



More information about the asterisk-dev mailing list