[asterisk-commits] kpfleming: branch 10 r370361 - in /branches/10: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 23 09:51:26 CDT 2012


Author: kpfleming
Date: Mon Jul 23 09:51:21 2012
New Revision: 370361

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=370361
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.

(related to issue AST-916)
........

Merged revisions 370360 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/channel.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/channel.c?view=diff&rev=370361&r1=370360&r2=370361
==============================================================================
--- branches/10/main/channel.c (original)
+++ branches/10/main/channel.c Mon Jul 23 09:51:21 2012
@@ -2527,6 +2527,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