[Asterisk-code-review] app voicemail: avoid race on IMAP logout (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Thu Jun 15 15:50:03 CDT 2017


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/5853


Change subject: app_voicemail: avoid race on IMAP logout
......................................................................

app_voicemail: avoid race on IMAP logout

Need to lock IMAP vm_state to avoid race condition.

ASTERISK-24052 #close

Change-Id: Id33ef3363cc7eeeb3e5ebb37b8f5566c711d9486
---
M apps/app_voicemail.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/5853/1

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 0c0e2ba..4e42b1c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -13057,7 +13057,10 @@
 		return;
 	}
 
+	ast_mutex_lock(&vms->lock);
 	vms->mailstream = mail_close(vms->mailstream);
+	ast_mutex_unlock(&vms->lock);
+
 	vmstate_delete(vms);
 }
 

-- 
To view, visit https://gerrit.asterisk.org/5853
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id33ef3363cc7eeeb3e5ebb37b8f5566c711d9486
Gerrit-Change-Number: 5853
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170615/939615ad/attachment.html>


More information about the asterisk-code-review mailing list