[asterisk-dev] [Code Review] 4128: func_jitterbuffer: fix frame leaks
rmudgett
reviewboard at asterisk.org
Thu Oct 30 19:32:28 CDT 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4128/#review13639
-----------------------------------------------------------
/branches/11/funcs/func_jitterbuffer.c
<https://reviewboard.asterisk.org/r/4128/#comment24154>
This will free the passed in frame when the old one is replaced.
if (res == AST_JB_IMPL_OK) {
+ if (jbframe != frame) {
+ ast_frfree(frame);
+ }
frame = &ast_null_frame;
+ } else if (jbframe != frame) {
+ ast_frfree(jbframe);
}
/branches/11/funcs/func_jitterbuffer.c
<https://reviewboard.asterisk.org/r/4128/#comment24155>
You don't need the if test. Just do it.
/branches/11/funcs/func_jitterbuffer.c
<https://reviewboard.asterisk.org/r/4128/#comment24158>
While I was here I added a blank line after the variable declaration.
/branches/11/funcs/func_jitterbuffer.c
<https://reviewboard.asterisk.org/r/4128/#comment24156>
ast_frfree(frame) before dup replaces frame.
/branches/11/funcs/func_jitterbuffer.c
<https://reviewboard.asterisk.org/r/4128/#comment24157>
ast_frfree(frame) before replacing with null frame.
- rmudgett
On Oct. 30, 2014, 7:06 p.m., Corey Farrell wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4128/
> -----------------------------------------------------------
>
> (Updated Oct. 30, 2014, 7:06 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-22409
> https://issues.asterisk.org/jira/browse/ASTERISK-22409
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> These changes are not controversial and fix a memory leak so they are now split from r3603.
>
> In 12+ these changes apply to main/abstract_js.c instead of funcs/func_jitterbuffer.c.
>
>
> Diffs
> -----
>
> /branches/11/funcs/func_jitterbuffer.c 426593
>
> Diff: https://reviewboard.asterisk.org/r/4128/diff/
>
>
> Testing
> -------
>
> tests/funcs/func_jitterbuffer against 13 no longer leaks.
>
>
> Thanks,
>
> Corey Farrell
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141031/0d05b9c3/attachment-0001.html>
More information about the asterisk-dev
mailing list