mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-09 05:01:28 +00:00
secret: Add NULL obj check to virSecretObjListRemove
Rather than have the caller check if !obj before calling, just check in the function for !obj and return. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
6f8c858c74
commit
6de89f33fa
@ -298,6 +298,9 @@ virSecretObjListRemove(virSecretObjListPtr secrets,
|
|||||||
{
|
{
|
||||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
|
|
||||||
|
if (!obj)
|
||||||
|
return;
|
||||||
|
|
||||||
virUUIDFormat(secret->def->uuid, uuidstr);
|
virUUIDFormat(secret->def->uuid, uuidstr);
|
||||||
virObjectRef(secret);
|
virObjectRef(secret);
|
||||||
virObjectUnlock(secret);
|
virObjectUnlock(secret);
|
||||||
@ -915,7 +918,6 @@ virSecretLoad(virSecretObjListPtr secrets,
|
|||||||
secret = NULL;
|
secret = NULL;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (secret)
|
|
||||||
virSecretObjListRemove(secrets, secret);
|
virSecretObjListRemove(secrets, secret);
|
||||||
virSecretDefFree(def);
|
virSecretDefFree(def);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user