mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-01 06:42:22 +00:00
virsh: don't call virSecretFree on NULL
Since the refactoring in fbe2d49 we call virSecretFree even if virSecretDefineXML fails, which leads to overwriting the error message with: error: Invalid secret: virSecretFree Bug: https://bugzilla.redhat.com/show_bug.cgi?id=929045 (cherry picked from commit bfb4b822579ce1afcbc396fe4bc3b57fb3ebc150)
This commit is contained in:
parent
752b683c1b
commit
66e8f041f9
@ -117,7 +117,8 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(buffer);
|
||||
virSecretFree(res);
|
||||
if (res)
|
||||
virSecretFree(res);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user