core: Forgot to dereference pointer when checking for NULL

Actually we already checked for !rt before, now we'd like to examine
the return value of the memory allocation.