mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
rbd: Do not free the secret if it is not set
Not all RBD (Ceph) storage pools have cephx authentication turned on,
so "secret" might not be initialized.
It could also be that the secret couldn't be located.
Only call virSecretFree() if "secret" is initialized earlier.
Signed-off-by: Wido den Hollander <wido@widodh.nl>
(cherry picked from commit d58c847844
)
This commit is contained in:
parent
146d12c6cc
commit
c636c41af7
@ -176,7 +176,10 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
||||
cleanup:
|
||||
VIR_FREE(secret_value);
|
||||
VIR_FREE(rados_key);
|
||||
virSecretFree(secret);
|
||||
|
||||
if (secret != NULL)
|
||||
virSecretFree(secret);
|
||||
|
||||
virBufferFreeAndReset(&mon_host);
|
||||
VIR_FREE(mon_buff);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user