[asterisk-dev] memory leak in chan_agent.c

Christian crich-ml at beronet.com
Wed Mar 7 15:14:23 MST 2007


Russell Bryant wrote:
> Christian wrote:
>> i was just reading chan_agent.c (svn 1.4 head) and found that in
>> "add_agent" (line :299) there is a "parse" variable allocated which
>> never seems to be freed. Is that correct or does the app_args_parse
>> stuff magically free that later ? I assume this is a memory leak, if
>> somebody confirms i'll fix that and check for other mem leaks like that.
>
> parse = ast_strdupa(agent);
>
> Note that this is strdupa, and not strdup.  This function just 
> allocates memory on the stack, so there is no need to free it.
>
oh .. sorry didn't look at the implementation :) thx. for the hint, will 
use it next time when i need a copy only locally :)



More information about the asterisk-dev mailing list