提交 6de89f33 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 6f8c858c
......@@ -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,8 +918,7 @@ virSecretLoad(virSecretObjListPtr secrets,
secret = NULL;
cleanup:
if (secret)
virSecretObjListRemove(secrets, secret);
virSecretObjListRemove(secrets, secret);
virSecretDefFree(def);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册