diff options
author | antirez <antirez@gmail.com> | 2011-12-07 08:58:29 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-12-07 08:58:29 +0100 |
commit | fb293ccbddb43f427ea1f791d8603fbd18e703e6 (patch) | |
tree | 0bdb48101bc9ae39459f8faba560f75b5ac07ef5 /src/ae_kqueue.c | |
parent | 237194b76064c95028b14e9ff7d7abfb10abd63d (diff) | |
download | redis-fb293ccbddb43f427ea1f791d8603fbd18e703e6.tar.gz |
Fixed a theoretical memory leak with no practical effects in ae_kqueue.c and ae_epoll.c, thanks to magicyang87 for reporting it.
Diffstat (limited to 'src/ae_kqueue.c')
-rw-r--r-- | src/ae_kqueue.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ae_kqueue.c b/src/ae_kqueue.c index 04c3536ba..6bf64f4ef 100644 --- a/src/ae_kqueue.c +++ b/src/ae_kqueue.c @@ -16,7 +16,10 @@ static int aeApiCreate(aeEventLoop *eventLoop) { if (!state) return -1; state->kqfd = kqueue(); - if (state->kqfd == -1) return -1; + if (state->kqfd == -1) { + zfree(state); + return -1; + } eventLoop->apidata = state; return 0; |