mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
osdc: fix a memory leak in C_TwoContexts
If an ObjectOperation op is cancelled, its destructor is called and each Context object in out_handler is deleted. A C_TwoContexts object can be one of these handlers. The two contexts wrapped in C_TwoContexts must be deleted as well. Signed-off-by: Xiong Yiliang <xiongyiliang@xunlei.com>
This commit is contained in:
parent
b3462c2e85
commit
f33cdbe485
@ -89,6 +89,13 @@ struct ObjectOperation {
|
||||
void finish(int r) {
|
||||
first->complete(r);
|
||||
second->complete(r);
|
||||
first = NULL;
|
||||
second = NULL;
|
||||
}
|
||||
|
||||
virtual ~C_TwoContexts() {
|
||||
delete first;
|
||||
delete second;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user