Fix use-after-free in osd_flush.cpp

sync-io-test
Vitaliy Filippov 2020-06-01 00:34:04 +03:00
parent 73e4e30b1f
commit 3a5d488f19
1 changed files with 2 additions and 1 deletions

View File

@ -270,9 +270,10 @@ void osd_t::submit_recovery_op(osd_recovery_op_t *op)
throw std::runtime_error("Failed to recover an object"); throw std::runtime_error("Failed to recover an object");
} }
} }
// CAREFUL! op = &recovery_ops[op->oid]. Don't access op->* after recovery_ops.erase()
op->osd_op = NULL;
recovery_ops.erase(op->oid); recovery_ops.erase(op->oid);
delete osd_op; delete osd_op;
op->osd_op = NULL;
continue_recovery(); continue_recovery();
}; };
exec_op(op->osd_op); exec_op(op->osd_op);