Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj) combo the virSecretObjEndAPI() can be used. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/conf/virsecretobj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index bdd5e4a6f7..212cfe103c 100644 --- a/src/conf/virsecretobj.c +++ b/src/conf/virsecretobj.c @@ -301,8 +301,7 @@ virSecretObjListRemove(virSecretObjList *secrets, virObjectRWLockWrite(secrets); virObjectLock(obj); virHashRemoveEntry(secrets->objs, uuidstr); - virObjectUnlock(obj); - virObjectUnref(obj); + virSecretObjEndAPI(&obj); virObjectRWUnlock(secrets); } -- 2.32.0