null point dereference on err