From 8fdfece9fd5419eeb1bc65b3ac4987f6e150fd9f Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 4 Mar 2014 15:21:09 -0800 Subject: [PATCH] ReplicatedPG::fill_in_copy_get: fix early return bug This is not a leak: we are in an else block where cb must be NULL. The fix as introduced did not include braces on the if causing the method to return unconditionally. Fixes: #7604 Introduced in: 500206d809f0cd85cd99e4f0ec164bbf74f92c28 Reviewed-by: David Zafman Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5fee83428f78f..c95a7e59f70ba 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5274,9 +5274,6 @@ int ReplicatedPG::fill_in_copy_get( result = pgbackend->objects_read_sync( oi.soid, cursor.data_offset, left, &bl); if (result < 0) - if (cb) { - delete cb; - } return result; } assert(result <= left); -- 2.39.5