From: Jason Dillaman Date: Sat, 17 Sep 2016 12:29:15 +0000 (-0400) Subject: librbd: corrected use-after-free in ImageWatcher X-Git-Tag: v11.0.1~213^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11112%2Fhead;p=ceph.git librbd: corrected use-after-free in ImageWatcher Fixes: http://tracker.ceph.com/issues/17289 Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 21ca68c72cab..0a9c4590bb5a 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -62,9 +62,10 @@ struct C_UnwatchAndFlush : public Context { // to completing the callback to avoid racing an explicit // librados shutdown Context *ctx = on_finish; + r = ret_val; delete this; - ctx->complete(ret_val); + ctx->complete(r); } virtual void finish(int r) override {