[asterisk-commits] mmichelson: branch 10 r368899 - in /branches/10: ./ funcs/func_volume.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 13 16:13:33 CDT 2012


Author: mmichelson
Date: Wed Jun 13 16:13:30 2012
New Revision: 368899

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=368899
Log:
Fix a deadlock that occurs when func_volume is used on a local channel.

This was discovered by trying to perform a call forward to an extension
that makes use of func_volume. When the local channel is optimized away,
the datastore on the local;2 channel would have its audiohook destroyed
rather than detaching the audiohook from the channel and then destroying
it.

With this patch, func_volume's datastore destructor takes the proper
route of detaching the audiohook and then destroying it.

(closes issue ASTERISK-19611)
reported by Volker Sauer
Patches:
	ASTERISK-19611.patch uploaded by Mark Michelson (license #5049)
........

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

Modified:
    branches/10/   (props changed)
    branches/10/funcs/func_volume.c

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

Modified: branches/10/funcs/func_volume.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/funcs/func_volume.c?view=diff&rev=368899&r1=368898&r2=368899
==============================================================================
--- branches/10/funcs/func_volume.c (original)
+++ branches/10/funcs/func_volume.c Wed Jun 13 16:13:30 2012
@@ -90,6 +90,9 @@
 	struct volume_information *vi = data;
 
 	/* Destroy the audiohook, and destroy ourselves */
+	ast_audiohook_lock(&vi->audiohook);
+	ast_audiohook_detach(&vi->audiohook);
+	ast_audiohook_unlock(&vi->audiohook);
 	ast_audiohook_destroy(&vi->audiohook);
 	ast_free(vi);
 




More information about the asterisk-commits mailing list