From d71a243220db1e6bc04425b5988b8a9bc8523345 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 25 Jan 2021 14:26:35 +0100 Subject: error: Fix "Converting to ERRP_GUARD()" doc on "valid at return" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting errp = NULL is wrong: the automatic error propagation still propagates the dangling pointer _auto_errp_prop.local_err. We need to set *errp = NULL to clear the dangling pointer. Signed-off-by: Markus Armbruster Message-Id: <20210125132635.1253219-1-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé --- include/qapi/error.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qapi/error.h b/include/qapi/error.h index eaa05c4..4a9260b 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -235,7 +235,7 @@ * error_propagate_prepend(errp, *errp, ...) by error_prepend(errp, ...) * * 4. Ensure @errp is valid at return: when you destroy *errp, set - * errp = NULL. + * *errp = NULL. * * Example: * -- cgit v1.1