From 8ee92b87b9aa1a56f03bd6aa1caa48799e5363df Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 17 Nov 2020 13:13:54 -0500 Subject: [PATCH] librbd/api/Migration: fix potential double-close of image Signed-off-by: Jason Dillaman --- src/librbd/api/Migration.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librbd/api/Migration.cc b/src/librbd/api/Migration.cc index b1f3542dbb98..9f7d4d791490 100644 --- a/src/librbd/api/Migration.cc +++ b/src/librbd/api/Migration.cc @@ -269,6 +269,7 @@ int open_images(librados::IoCtx& io_ctx, const std::string &image_name, ldout(cct, 10) << "re-opening the destination image" << dendl; r = image_ctx->state->open(0); if (r < 0) { + image_ctx = nullptr; lderr(cct) << "failed to re-open destination image: " << cpp_strerror(r) << dendl; return r; -- 2.47.3