Assignment to a pointer is non-atomic.

Reading the pointer (in both, the if and the return) might get
"half" of the update, resulting in an invalid pointer being used.