From: Jason Dillaman Date: Tue, 17 Nov 2020 18:13:54 +0000 (-0500) Subject: librbd/api/Migration: fix potential double-close of image X-Git-Tag: v16.1.0~479^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ee92b87b9aa1a56f03bd6aa1caa48799e5363df;p=ceph.git librbd/api/Migration: fix potential double-close of image Signed-off-by: Jason Dillaman --- 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;