[asterisk-dev] [Code Review] Fix possible memory leak with SIP realtime regs
Olle E Johansson
reviewboard at asterisk.org
Thu Sep 29 02:57:40 CDT 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1465/#review4448
-----------------------------------------------------------
Looking at the code for ast_variables_destroy you don't need to check if the variables exist before calling it.
void ast_variables_destroy(struct ast_variable *v)
{
struct ast_variable *vn;
while (v) {
vn = v;
v = v->next;
ast_variable_destroy(vn);
}
}
/O
- Olle E
On Sept. 28, 2011, 6:23 p.m., Terry Wilson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1465/
> -----------------------------------------------------------
>
> (Updated Sept. 28, 2011, 6:23 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> It was possible that if realtime sipregs are used, that the varregs variable returned by ast_load_realtime() would not be freed. This patch aims to correct that.
>
>
> This addresses bug ASTERISK-17792.
> https://issues.asterisk.org/jira/browse/ASTERISK-17792
>
>
> Diffs
> -----
>
> /branches/1.8/channels/chan_sip.c 338223
>
> Diff: https://reviewboard.asterisk.org/r/1465/diff
>
>
> Testing
> -------
>
> It compiles. We return NULL in every case that ast_variables_destroy(varregs) is called, so there should be no chance of causing a problem with destroying the variable multiple times, etc.
>
>
> Thanks,
>
> Terry
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110929/32e5984c/attachment.htm>
More information about the asterisk-dev
mailing list