The set_priv() call consumes a ref. Technically the local 's' is not
actually owned by use by the time we get to the con_front set_priv().
Signed-off-by: Sage Weil <sage@inktank.com>
hi->peer = p;
HeartbeatSession *s = new HeartbeatSession(p);
hi->con_back = cons.first.get();
- hi->con_back->set_priv(s);
+ hi->con_back->set_priv(s->get());
if (cons.second) {
hi->con_front = cons.second.get();
hi->con_front->set_priv(s->get());
<< " " << hi->con_back->get_peer_addr()
<< dendl;
}
+ s->put();
} else {
hi = &i->second;
}