libceph: introduce ceph_x_authorizer_cleanup()
Commit ae385eaf24 ("libceph: store session key in cephx authorizer")
introduced ceph_x_authorizer::session_key, but didn't update all the
exit/error paths. Introduce ceph_x_authorizer_cleanup() to encapsulate
ceph_x_authorizer cleanup and switch to it. This fixes ceph_x_destroy(),
which currently always leaks key and ceph_x_build_authorizer() error
paths.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
@@ -16,8 +16,10 @@ struct ceph_crypto_key {
|
||||
|
||||
static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
|
||||
{
|
||||
if (key)
|
||||
if (key) {
|
||||
kfree(key->key);
|
||||
key->key = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int ceph_crypto_key_clone(struct ceph_crypto_key *dst,
|
||||
|
||||
Reference in New Issue
Block a user