Replace alloc() with xmalloc() and remove immediate OOM checks (part 2)