]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 370361 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Mon, 23 Jul 2012 15:24:10 +0000 (15:24 +0000)
committerAutomerge script <automerge@asterisk.org>
Mon, 23 Jul 2012 15:24:10 +0000 (15:24 +0000)
file:///srv/subversion/repos/asterisk/branches/10

................
  r370361 | kpfleming | 2012-07-23 09:51:21 -0500 (Mon, 23 Jul 2012) | 13 lines

  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
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@370381 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 7a19cd1a549f0b908b1d2d49e012217a955c732c..3530d6bdae4a898e8ac1ce316b82b1351c6f0708 100644 (file)
@@ -2527,6 +2527,13 @@ static void ast_dummy_channel_destructor(void *obj)
        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;