mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
librbd/crypto: fix memory leak in ShutDownCryptoRequest
If crypto object dispatch does not exist, a context pointer is leaked. This commit fixes this issue. Signed-off-by: Or Ozeri <oro@il.ibm.com>
This commit is contained in:
parent
0f61c82d2e
commit
044280dcbe
@ -39,15 +39,16 @@ void ShutDownCryptoRequest<I>::send() {
|
||||
|
||||
template <typename I>
|
||||
void ShutDownCryptoRequest<I>::shut_down_object_dispatch() {
|
||||
auto ctx = create_context_callback<
|
||||
ShutDownCryptoRequest<I>,
|
||||
&ShutDownCryptoRequest<I>::handle_shut_down_object_dispatch>(this);
|
||||
if (!m_image_ctx->io_object_dispatcher->exists(
|
||||
io::OBJECT_DISPATCH_LAYER_CRYPTO)) {
|
||||
finish(0);
|
||||
return;
|
||||
}
|
||||
|
||||
auto ctx = create_context_callback<
|
||||
ShutDownCryptoRequest<I>,
|
||||
&ShutDownCryptoRequest<I>::handle_shut_down_object_dispatch>(this);
|
||||
|
||||
m_image_ctx->io_object_dispatcher->shut_down_dispatch(
|
||||
io::OBJECT_DISPATCH_LAYER_CRYPTO, ctx);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user