From: Marc-André Lureau <marcandre.lur...@redhat.com> Sometime, ERRP_GUARD() isn't what you are looking for, because the function doesn't throw errors, yet auto-cleaning is nice to have.
Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- include/qapi/error.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qapi/error.h b/include/qapi/error.h index d798faeec3e9..9482b6a58ae6 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -519,6 +519,8 @@ static inline void error_propagator_cleanup(ErrorPropagator *prop) G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(ErrorPropagator, error_propagator_cleanup); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(Error, error_free); + /* * Special error destination to abort on error. * See error_setg() and error_propagate() for details. -- 2.36.0.44.g0f828332d5ac