Move chkptr() to alloc.c