From 891d0a76b5ad34959c585660a62d13d51d1b8a96 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 20 Apr 2017 11:22:21 -0400 Subject: [PATCH] secret: Have virSecretObjNew return locked object Rather than have caller need to do it, have the object returned locked. Signed-off-by: John Ferlan --- src/conf/virsecretobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index cc18459618..55624f4c1a 100644 --- a/src/conf/virsecretobj.c +++ b/src/conf/virsecretobj.c @@ -97,6 +97,8 @@ virSecretObjNew(void) if (!(secret = virObjectLockableNew(virSecretObjClass))) return NULL; + virObjectLock(secret); + return secret; } @@ -386,8 +388,6 @@ virSecretObjListAddLocked(virSecretObjListPtr secrets, if (!(secret = virSecretObjNew())) goto cleanup; - virObjectLock(secret); - if (virHashAddEntry(secrets->objs, uuidstr, secret) < 0) goto cleanup; -- GitLab