Review Board 1.7.16


Memory leak cleanups

Review Request #4389 - Created Jan. 29, 2015 and submitted

Mark Michelson
/branches/13
ASTERISK-24736
Reviewers
asterisk-dev
Asterisk
John Hardin of Digium did some investigation into memory leaks he was seeing and created a set of patches that fixes them. I've already given these patches a look and have made a few small adjustments to them where necessary for coding guidelines reasons. Most of the leak fixes are pretty straightforward, but one of these bears a bit of explanation:

Prior to Asterisk 12, originating calls with channel variables required that you transfer ownership of the created ast_variables structure away when calling ast_pbx_outgoing_exten() or ast_pbx_outgoing_app(). This was presumably because these functions could spawn threads that required these variables to not be freed yet. However, in Asterisk 12, ast_pbx_outgoing_exten() and ast_pbx_outgoing_app() were rewritten to not use the variables in the spawned threads. However, we also stopped actually destroying the variables there, too. So with this patch, responsibility for freeing the variables lies with the original creator of the variables.
John Hardin's testing with valgrind has shown that the memory leaks it had been reported are no longer present.
Total:
1
Open:
0
Resolved:
1
Dropped:
0
Status:
From:
Description From Last Updated Status
Review request changed
Updated (Jan. 30, 2015, 11:25 a.m.)
  • changed from pending to submitted
Committed in revision 431488

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.