]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: corrected use-after-free in ImageWatcher 11112/head
authorJason Dillaman <dillaman@redhat.com>
Sat, 17 Sep 2016 12:29:15 +0000 (08:29 -0400)
committerJason Dillaman <dillaman@redhat.com>
Sat, 17 Sep 2016 12:29:15 +0000 (08:29 -0400)
Fixes: http://tracker.ceph.com/issues/17289
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageWatcher.cc

index 21ca68c72cab8bed281cae2a8a582433a5b09b1a..0a9c4590bb5a7c3447dc017bc44799b6867c44b0 100644 (file)
@@ -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 {