mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 18:05:20 +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];
|
||||
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
virUUIDFormat(secret->def->uuid, uuidstr);
|
||||
virObjectRef(secret);
|
||||
virObjectUnlock(secret);
|
||||
@ -915,7 +918,6 @@ virSecretLoad(virSecretObjListPtr secrets,
|
||||
secret = NULL;
|
||||
|
||||
cleanup:
|
||||
if (secret)
|
||||
virSecretObjListRemove(secrets, secret);
|
||||
virSecretDefFree(def);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user