Avoid leaking namebuf in case of an early exit