[asterisk-commits] kpfleming: branch 1.8 r370360 - /branches/1.8/main/channel.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 23 09:41:07 CDT 2012
Author: kpfleming
Date: Mon Jul 23 09:41:03 2012
New Revision: 370360
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370360
Log:
Free any datastores attached to dummy channels.
Revision 370205 added the use of a datastore attached to a dummy channel to
resolve a memory leak, but ast_dummy_channel_destructor() in this branch did
not free datastores, resulting in a continued (but slightly smaller) memory
leak. This patch backports the change to free said datastores from the Asterisk
trunk.
Modified:
branches/1.8/main/channel.c
Modified: branches/1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/channel.c?view=diff&rev=370360&r1=370359&r2=370360
==============================================================================
--- branches/1.8/main/channel.c (original)
+++ branches/1.8/main/channel.c Mon Jul 23 09:41:03 2012
@@ -2499,6 +2499,13 @@
struct ast_channel *chan = obj;
struct ast_var_t *vardata;
struct varshead *headp;
+ struct ast_datastore *datastore;
+
+ /* Get rid of each of the data stores on the channel */
+ while ((datastore = AST_LIST_REMOVE_HEAD(&chan->datastores, entry))) {
+ /* Free the data store */
+ ast_datastore_free(datastore);
+ }
headp = &chan->varshead;
More information about the asterisk-commits
mailing list