[asterisk-dev] memory leak in chan_agent.c

Russell Bryant russell at digium.com
Wed Mar 7 10:56:23 MST 2007

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.

Russell Bryant
Software Engineer
Digium, Inc.

More information about the asterisk-dev mailing list