diff options
author | xie xingguo <xie.xingguo@zte.com.cn> | 2016-06-14 04:52:15 +0200 |
---|---|---|
committer | xie xingguo <xie.xingguo@zte.com.cn> | 2016-06-14 05:34:58 +0200 |
commit | 4c52bf9ed47d52510536ebc34bd6c56adba1df53 (patch) | |
tree | 244ceba487a5882a9ed360814598befaebc51b96 /src/mds | |
parent | mds/SessionMap: explicitly require importing_count to be postive (diff) | |
download | ceph-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.h | 6 |
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; |