diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 493e33bc40adeed9161bb385e345e841d11460cc..badbdac96250aad72a3e5eee3563946cb26ec19c 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -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;