These previously would not check that the return value was non-null meaning it was susceptible to a sigsegv. This checks those values.