Previously, Masquerade would unlock 'original' and 'clonechan' and allow another masq thread to run.
End result would be corrupted memory, and the frequent report 'Bad Magic Number'.
(closes issue #17801,#17710)
Reported by: notthematrix
Patches:
Based on bug17801.diff1.txt uploaded by alecdavis (license 585)
Tested by: alecdavis
Review: https://reviewboard.asterisk.org/r/928
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287661
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
ao2_unlink(channels, original);
ao2_unlink(channels, clonechan);
- /* now that both channels are locked and unlinked from the container, it is safe to unlock it */
- ao2_unlock(channels);
-
ast_debug(4, "Actually Masquerading %s(%d) into the structure of %s(%d)\n",
clonechan->name, clonechan->_state, original->name, original->_state);
ao2_link(channels, original);
}
+ ao2_unlock(channels);
+
return 0;
}