librbd: rename of non-existent image results in seg fault

Fixes: http://tracker.ceph.com/issues/21248
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2017-09-05 12:11:45 -04:00
parent 149778edde
commit 4a75ee43d3

View File

@ -970,8 +970,7 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) {
ImageCtx *ictx = new ImageCtx(srcname, "", "", io_ctx, false);
int r = ictx->state->open(false);
if (r < 0) {
lderr(ictx->cct) << "error opening source image: " << cpp_strerror(r)
<< dendl;
lderr(cct) << "error opening source image: " << cpp_strerror(r) << dendl;
return r;
}
BOOST_SCOPE_EXIT((ictx)) {