summaryrefslogtreecommitdiff
path: root/src/ae_epoll.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-12-07 08:58:29 +0100
committerantirez <antirez@gmail.com>2011-12-07 08:58:29 +0100
commitfb293ccbddb43f427ea1f791d8603fbd18e703e6 (patch)
tree0bdb48101bc9ae39459f8faba560f75b5ac07ef5 /src/ae_epoll.c
parent237194b76064c95028b14e9ff7d7abfb10abd63d (diff)
downloadredis-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_epoll.c')
-rw-r--r--src/ae_epoll.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ae_epoll.c b/src/ae_epoll.c
index d48977b65..5680b6a27 100644
--- a/src/ae_epoll.c
+++ b/src/ae_epoll.c
@@ -14,7 +14,10 @@ static int aeApiCreate(aeEventLoop *eventLoop) {
if (!state) return -1;
state->epfd = epoll_create(1024); /* 1024 is just an hint for the kernel */
- if (state->epfd == -1) return -1;
+ if (state->epfd == -1) {
+ zfree(state);
+ return -1;
+ }
eventLoop->apidata = state;
return 0;
}