Add assert to MonSessionMap::new_session().
Fix for:
CID
1128408 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking s suggests that it may be
null, but it has already been dereferenced on all paths
leading to the check.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
dout(10) << "do not have session, making new one" << dendl;
s = session_map.new_session(m->get_source_inst(), m->get_connection().get());
+ assert(s);
m->get_connection()->set_priv(s->get());
dout(10) << "ms_dispatch new session " << s << " for " << s->inst << dendl;
op->set_session(s);
MonSession *new_session(const entity_inst_t& i, Connection *c) {
MonSession *s = new MonSession(i, c);
+ assert(s);
sessions.push_back(&s->item);
if (i.name.is_osd())
by_osd.insert(pair<int,MonSession*>(i.name.num(), s));