From 2daaa61bc22ae21cc4a780a150a66d2bf45b4705 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 25 May 2015 11:35:01 +0800 Subject: [PATCH] mds: fix use-after-free in SessionMap::remove_session Fixes: #11752 Signed-off-by: Yan, Zheng --- src/mds/SessionMap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index cd45b35f18881..faaeb2669d654 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -584,11 +584,11 @@ void SessionMap::remove_session(Session *s) s->trim_completed_requests(0); s->item_session_list.remove_myself(); session_map.erase(s->info.inst.name); - s->put(); if (dirty_sessions.count(s->info.inst.name)) { dirty_sessions.erase(s->info.inst.name); } null_sessions.insert(s->info.inst.name); + s->put(); } void SessionMap::touch_session(Session *session) -- 2.39.5