From 43749377cbdfa1f64e157bcb8691c55d03a5aad5 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 20 Oct 2020 02:55:36 -0400 Subject: [PATCH] librbd/api: ImageCtx must be closed instead of deleted On error, the destination image context will need to be properly closed instead of just deleted. Signed-off-by: Jason Dillaman --- src/librbd/api/Migration.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librbd/api/Migration.cc b/src/librbd/api/Migration.cc index d3c1e0479b0..565257168eb 100644 --- a/src/librbd/api/Migration.cc +++ b/src/librbd/api/Migration.cc @@ -753,7 +753,7 @@ int Migration::prepare() { BOOST_SCOPE_EXIT_TPL(&m_dst_image_ctx) { if (m_dst_image_ctx != nullptr) { - delete m_dst_image_ctx; + m_dst_image_ctx->state->close(); } } BOOST_SCOPE_EXIT_END;