[asterisk-dev] [Code Review] Fix possible memory leak with SIP realtime regs

Terry Wilson reviewboard at asterisk.org
Thu Sep 29 12:53:25 CDT 2011


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

(Updated Sept. 29, 2011, 12:53 p.m.)


Review request for Asterisk Developers.


Changes
-------

Address Olle's comments and free the peerlist instead of just setting it to NULL and rebuilding it to make it fix all of the bugs in ASTERISK-18356 and review 1395. While I like the readability changes in that review, I worry about refactoring the code and introducing behavior changes to a released branch. It seems like if we are going to make those changes, we should do it in trunk and update the UPGRADE.txt/CHANGES files appropriately. I think fixing things this way, at least in 1.8 and 10, seems simpler and safer, but I am more than willing to discuss it.


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 (updated)
-----

  /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/9478b79f/attachment.htm>


More information about the asterisk-dev mailing list