From 639ff9f776bf7e18ba9d8bd0f73784df0bf02ce0 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 4 Oct 2013 09:47:54 -0700 Subject: [PATCH] ReplicatedPG: copy: don't leak a ctx on failed copy ops Signed-off-by: Greg Farnum --- src/osd/ReplicatedPG.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 2a8b722c752c8..f337a8f420223 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -180,11 +180,10 @@ public: } ctx->copy_cb = NULL; if (r < 0) { - if (r == -ECANCELED) { // toss it out; client resends - delete ctx; - } else { + if (r != -ECANCELED) { // on cancel just toss it out; client resends ctx->pg->osd->reply_op_error(ctx->op, r); } + delete ctx; } } -- 2.39.5