From: Mark Michelson Date: Wed, 13 Jun 2012 21:13:30 +0000 (+0000) Subject: Fix a deadlock that occurs when func_volume is used on a local channel. X-Git-Tag: 10.7.0-rc1~3^2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=161e2e19ece454a988014ac621bf8edc1a9ab1c6;p=thirdparty%2Fasterisk.git 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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@368899 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_volume.c b/funcs/func_volume.c index 39b5a8a08e..ce10b56807 100644 --- a/funcs/func_volume.c +++ b/funcs/func_volume.c @@ -90,6 +90,9 @@ static void destroy_callback(void *data) 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);