Leave and immediately reenter the critical section in sodium_misuse()

Keep running everything in the critical section from there.
This commit is contained in:
Frank Denis 2017-11-01 01:45:02 +01:00
parent 802830e4e6
commit 8d5b6b1fc9

View File

@ -178,9 +178,10 @@ sodium_misuse(void)
{
void (*handler)(void);
sodium_crit_leave();
if (sodium_crit_enter() == 0) {
handler = _misuse_handler;
if (sodium_crit_leave() == 0 && handler != NULL) {
if (handler != NULL) {
handler();
}
}