Skip to content

Commit

Permalink
osd: fix reference leak
Browse files Browse the repository at this point in the history
ctx will be moved, so replace it with the value

Signed-off-by: Myoungwon Oh <ohmyoungwon@gmail.com>
  • Loading branch information
myoungwon committed Jul 8, 2020
1 parent 02690a7 commit 65c99a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/osd/PrimaryLogPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3515,9 +3515,12 @@ void PrimaryLogPG::dec_all_refcount_manifest(const object_info_t& oi, OpContext*
refs);

if (!refs.is_empty()) {
hobject_t soid = ctx->obc->obs.oi.soid;
ctx->register_on_commit(
[ctx, this, refs](){
dec_refcount(ctx->obc, refs);
[soid, this, refs](){
ObjectContextRef obc = get_object_context(soid, false, NULL);
ceph_assert(obc);
dec_refcount(obc, refs);
});
}
} else if (oi.manifest.is_redirect()) {
Expand Down

0 comments on commit 65c99a4

Please sign in to comment.