According to asprintf(3) the content off errmsg is undefined
on error, lets set it to NULL.