Fix cl->read_op being freed without calling the completion callback

Vitaliy Filippov 2020-12-30 16:55:37 +03:00
parent b88b76f316
commit f4ea313707
1 changed files with 8 additions and 1 deletions

View File

@ -347,8 +347,15 @@ void osd_messenger_t::stop_client(int peer_fd)
osd_peer_fds.erase(cl->osd_num); osd_peer_fds.erase(cl->osd_num);
} }
if (cl->read_op) if (cl->read_op)
{
if (cl->read_op->callback)
{
cancel_op(cl->read_op);
}
else
{ {
delete cl->read_op; delete cl->read_op;
}
cl->read_op = NULL; cl->read_op = NULL;
} }
for (auto rit = read_ready_clients.begin(); rit != read_ready_clients.end(); rit++) for (auto rit = read_ready_clients.begin(); rit != read_ready_clients.end(); rit++)