From: Walter Doekes Date: Wed, 28 May 2014 09:43:03 +0000 (+0000) Subject: chan_unistim: Unlock mutex in rare OOM condition. X-Git-Tag: 12.4.0-rc1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b30bd9a8e4809456d6d6fe915b8ab20177b2bdee;p=thirdparty%2Fasterisk.git chan_unistim: Unlock mutex in rare OOM condition. #ASTERISK-23792 #close Reported by: Peter Whisker Review: https://reviewboard.asterisk.org/r/3567/ ........ Merged revisions 414677 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414678 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index 231bf591da..784bd33079 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -6257,10 +6257,10 @@ static struct unistim_device *build_device(const char *cat, const struct ast_var } d = d->next; } + ast_mutex_unlock(&devicelock); if (!(lt = ast_calloc(1, sizeof(*lt)))) { return NULL; } - ast_mutex_unlock(&devicelock); if (create) { if (!(d = ast_calloc(1, sizeof(*d)))) { return NULL;