From: myoungwon oh Date: Wed, 2 Dec 2020 00:52:30 +0000 (+0900) Subject: osd: fix memory leak in C_SetManifestRefCountDone X-Git-Tag: v16.1.0~374^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=29d442b4c7e0be1fd9f765049d00c65a978fa373;p=ceph.git osd: fix memory leak in C_SetManifestRefCountDone Signed-off-by: Myoungwon Oh --- 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; + } } };