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

This commit is contained in:
Vitaliy Filippov
2020-12-30 16:55:54 +03:00
parent b88b76f316
commit f4ea313707
+8 -1
View File
@@ -348,7 +348,14 @@ void osd_messenger_t::stop_client(int peer_fd)
}
if (cl->read_op)
{
delete cl->read_op;
if (cl->read_op->callback)
{
cancel_op(cl->read_op);
}
else
{
delete cl->read_op;
}
cl->read_op = NULL;
}
for (auto rit = read_ready_clients.begin(); rit != read_ready_clients.end(); rit++)