summaryrefslogtreecommitdiffstats
path: root/src/mds
diff options
context:
space:
mode:
authorxie xingguo <xie.xingguo@zte.com.cn>2016-06-14 04:52:15 +0200
committerxie xingguo <xie.xingguo@zte.com.cn>2016-06-14 05:34:58 +0200
commit4c52bf9ed47d52510536ebc34bd6c56adba1df53 (patch)
tree244ceba487a5882a9ed360814598befaebc51b96 /src/mds
parentmds/SessionMap: explicitly require importing_count to be postive (diff)
downloadceph-4c52bf9ed47d52510536ebc34bd6c56adba1df53.tar.xz
ceph-4c52bf9ed47d52510536ebc34bd6c56adba1df53.zip
mds/SessionMap: avoid potential memory leak
This is safer and clean. Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Diffstat (limited to 'src/mds')
-rw-r--r--src/mds/SessionMap.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h
index 3ab7be65c83..a32115dde24 100644
--- a/src/mds/SessionMap.h
+++ b/src/mds/SessionMap.h
@@ -433,6 +433,12 @@ public:
loaded_legacy(false)
{ }
+ ~SessionMap()
+ {
+ for (auto p : by_state)
+ delete p.second;
+ }
+
void set_version(const version_t v)
{
version = projected = v;