Skip to content

Commit

Permalink
librbd: corrected use-after-free in ImageWatcher
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/17289
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed Sep 17, 2016
1 parent d5a9d0e commit 2f4d486
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librbd/ImageWatcher.cc
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f4d486

Please sign in to comment.