config: don't use freed memory on error Change the order and set a NULL so we don't try to access freed memory in case of an error.