aeDeleteEventLoop use after free and leak fixes
Former-commit-id: 2fd93c5789a4e81455d51b2a4786f708e8d6a2d7
This commit is contained in:
parent
d4c1e98124
commit
4bf9beb484
10
src/ae.cpp
10
src/ae.cpp
@ -390,10 +390,18 @@ extern "C" void aeDeleteEventLoop(aeEventLoop *eventLoop) {
|
|||||||
aeApiFree(eventLoop);
|
aeApiFree(eventLoop);
|
||||||
zfree(eventLoop->events);
|
zfree(eventLoop->events);
|
||||||
zfree(eventLoop->fired);
|
zfree(eventLoop->fired);
|
||||||
zfree(eventLoop);
|
|
||||||
fastlock_free(&eventLoop->flock);
|
fastlock_free(&eventLoop->flock);
|
||||||
close(eventLoop->fdCmdRead);
|
close(eventLoop->fdCmdRead);
|
||||||
close(eventLoop->fdCmdWrite);
|
close(eventLoop->fdCmdWrite);
|
||||||
|
|
||||||
|
auto *te = eventLoop->timeEventHead;
|
||||||
|
while (te)
|
||||||
|
{
|
||||||
|
auto *teNext = te->next;
|
||||||
|
zfree(te);
|
||||||
|
te = teNext;
|
||||||
|
}
|
||||||
|
zfree(eventLoop);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void aeStop(aeEventLoop *eventLoop) {
|
extern "C" void aeStop(aeEventLoop *eventLoop) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user