From 29d442b4c7e0be1fd9f765049d00c65a978fa373 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Wed, 2 Dec 2020 09:52:30 +0900 Subject: [PATCH] osd: fix memory leak in C_SetManifestRefCountDone Signed-off-by: Myoungwon Oh --- src/osd/PrimaryLogPG.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index f5460ab4361..dbfb596feb7 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3221,6 +3221,12 @@ struct C_SetManifestRefCountDone : public Context { } pg->manifest_ops.erase(it); cb->complete(r); + cb = nullptr; + } + ~C_SetManifestRefCountDone() { + if (cb) { + delete cb; + } } }; -- 2.39.5