Don't leak the temporary variables on success if NULL is returned for that field. Don't dereference NULL on failure to allocate some of the temporaries. Introduced by commit 990c3b6