[asterisk-dev] [Code Review] Continuing from 1643 (Allow specifying which MixMonitor to Stop)

Mark Michelson reviewboard at asterisk.org
Fri Jan 20 17:22:50 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1682/#review5253
-----------------------------------------------------------



/trunk/apps/app_mixmonitor.c
<https://reviewboard.asterisk.org/r/1682/#comment9784>

    Check the return of ast_asprintf() in case there was an allocation failure. It will return -1 if it was unable to allocate memory.



/trunk/apps/app_mixmonitor.c
<https://reviewboard.asterisk.org/r/1682/#comment9783>

    It's perfectly valid to free NULL pointers. You don't have to have the if around the ast_free() call



/trunk/apps/app_mixmonitor.c
<https://reviewboard.asterisk.org/r/1682/#comment9785>

    You need to be sure to free datastore_id even if ast_strlen_zero(uid_channel_var) evaluates true. You've got a memory leak as it is right now.



/trunk/apps/app_mixmonitor.c
<https://reviewboard.asterisk.org/r/1682/#comment9788>

    I believe you can do away with the ast_strdupa call here and pass opts[OPT_ARG_UID] directly into launch_monitor_thread



/trunk/apps/app_mixmonitor.c
<https://reviewboard.asterisk.org/r/1682/#comment9789>

    Since the args for the various mixmonitor commands are optional, referencing a->argv[3] may be referencing memory off the end of the argv array. These two commands need to be updated to make sure that argc > 3 before trying to reference argv[3]. Otherwise pass an empty string.



/trunk/apps/app_mixmonitor.c
<https://reviewboard.asterisk.org/r/1682/#comment9786>

    You can do away with the ast_strdupa() call here and just pass opts[OPT_ARG_UID] in directly to pbx_builtin_getvar_helper.


- Mark


On Jan. 20, 2012, 5:02 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1682/
> -----------------------------------------------------------
> 
> (Updated Jan. 20, 2012, 5:02 p.m.)
> 
> 
> Review request for Asterisk Developers, Mark Michelson and telecos.
> 
> 
> Summary
> -------
> 
> Fixes style problems from r6 on https://reviewboard.asterisk.org/r/1643/
> Changes creation of character buffer to length of a pointer in characters + 3 (2 for 0x, 1 for terminating space)
> 
> That might not be adequate.  Richard was saying something about pointers on other operating systems having other dividing symbols in them.  Well, at least ':'s.
> 
> In my experiences though, a pointer is usually just something like 0x0123FEDC when printed with %p.
> 
> 
> This addresses bug ASTERISK-19096.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19096
> 
> 
> Diffs
> -----
> 
>   /trunk/CHANGES 351538 
>   /trunk/apps/app_mixmonitor.c 351538 
> 
> Diff: https://reviewboard.asterisk.org/r/1682/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120120/4026b144/attachment-0001.htm>


More information about the asterisk-dev mailing list