aeDeleteEventLoop use after free and leak fixes

Former-commit-id: 77820e5d50e0426570285a2c740c47b05a7c6c2f
This commit is contained in:
John Sully 2020-02-16 03:33:45 -05:00
parent 98d15c7d14
commit f99b59ae96

View File

@ -402,10 +402,18 @@ extern "C" void aeDeleteEventLoop(aeEventLoop *eventLoop) {
aeApiFree(eventLoop);
zfree(eventLoop->events);
zfree(eventLoop->fired);
zfree(eventLoop);
fastlock_free(&eventLoop->flock);
close(eventLoop->fdCmdRead);
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) {