From: John Ferlan Date: Thu, 20 Apr 2017 15:22:21 +0000 (-0400) Subject: secret: Have virSecretObjNew return locked object X-Git-Tag: v3.3.0-rc1~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=891d0a76b5ad34959c585660a62d13d51d1b8a96;p=thirdparty%2Flibvirt.git secret: Have virSecretObjNew return locked object Rather than have caller need to do it, have the object returned locked. Signed-off-by: John Ferlan --- 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;