[asterisk-commits] jrose: branch 1.8 r313434 - in /branches/1.8: ./ channels/chan_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 12 13:25:54 CDT 2011
Author: jrose
Date: Tue Apr 12 13:25:48 2011
New Revision: 313434
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=313434
Log:
Merged revisions 313432 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r313432 | jrose | 2011-04-12 13:12:29 -0500 (Tue, 12 Apr 2011) | 14 lines
fixes a chan_dahdi reload memory leak that occurs when there are channel variables
reload chan_dahdi would cause variables to spill over from the previous config into the current config as
well as add any variables in the new config (if left the same, full on duplication) This patch purges variables
from pvts when they are reconfigured as well as from the configuration pvt once the configuration has been loaded.
(closes issue #17450)
Reported by: nahuelgreco
Patches:
patch.diff uploaded by jrose (license 1225)
Tested by: tilghman, jrose
Review: https://reviewboard.asterisk.org/r/1170/
........
Modified:
branches/1.8/ (props changed)
branches/1.8/channels/chan_dahdi.c
Propchange: branches/1.8/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.
Modified: branches/1.8/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_dahdi.c?view=diff&rev=313434&r1=313433&r2=313434
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Tue Apr 12 13:25:48 2011
@@ -12062,6 +12062,12 @@
}
if (tmp) {
+ /* If there are variables in tmp before it is updated to match the new config, clear them */
+ if (reloading && tmp->vars) {
+ ast_variables_destroy(tmp->vars);
+ tmp->vars = NULL;
+ }
+
int chan_sig = conf->chan.sig;
if (!here) {
@@ -17555,6 +17561,13 @@
} else if (!(options & PROC_DAHDI_OPT_NOWARN) )
ast_log(LOG_WARNING, "Ignoring any changes to '%s' (on reload) at line %d.\n", v->name, v->lineno);
}
+
+ /* Since confp has already filled invidual dahdi_pvt objects with channels at this point, clear the variables in confp's pvt. */
+ if (confp->chan.vars) {
+ ast_variables_destroy(confp->chan.vars);
+ confp->chan.vars = NULL;
+ }
+
if (dahdichan[0]) {
/* The user has set 'dahdichan' */
/*< \todo pass proper line number instead of 0 */
More information about the asterisk-commits
mailing list