Skip to content

Commit

Permalink
Merge pull request #11112 from dillaman/wip-17289
Browse files Browse the repository at this point in the history
librbd: corrected use-after-free in ImageWatcher

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
  • Loading branch information
Mykola Golub committed Sep 17, 2016
2 parents 19acda7 + 2f4d486 commit 3985ee2
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 3985ee2

Please sign in to comment.