]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: corrected use-after-free in ImageWatcher 11466/head
authorJason Dillaman <dillaman@redhat.com>
Sat, 17 Sep 2016 12:29:15 +0000 (08:29 -0400)
committerLoic Dachary <ldachary@redhat.com>
Thu, 13 Oct 2016 08:34:32 +0000 (10:34 +0200)
Fixes: http://tracker.ceph.com/issues/17289
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 2f4d4868e3b721c932c35ae7e8f0dd96b36a37fc)

src/librbd/ImageWatcher.cc

index c828163b8adb47ddab716148f130a03d9ec4078e..38083b42a5f437ba5a79490641673012a7557331 100644 (file)
@@ -61,9 +61,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 {