error: Fix "Converting to ERRP_GUARD()" doc on "valid at return"
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 <armbru@redhat.com> Message-Id: <20210125132635.1253219-1-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
fe352f5c00
commit
d71a243220
@ -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:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user