util/slab: do not dereference NULL-pointer
Compare changes
Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
This used to not be a problem, because these mutexes were the first members of this array, meaning that we ended up trying to lock/unlock NULL mutexes. But this isn't guaranteed to be allowed, so we were relying on luck here.
Recently, this changed. We introduced asserts for NULL-pointers, and changed the behavior in a way that leads to crashes in release-builds. This means we can't rely on luck any longer.
Fixes: e3171037 ("c11/threads: Remove Win32 null checks") Closes: #3903 (closed)