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;