glx: Move dereference and initialization to after NULL check.