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

Alexei Gradinari asteriskteam at digium.com
Fri Jun 16 10:45:26 CDT 2017


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


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/67/5867/1

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index eed2163..960443c 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -13136,7 +13136,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/5867
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id33ef3363cc7eeeb3e5ebb37b8f5566c711d9486
Gerrit-Change-Number: 5867
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/20170616/f51570cf/attachment.html>


More information about the asterisk-code-review mailing list