From fb293ccbddb43f427ea1f791d8603fbd18e703e6 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 7 Dec 2011 08:58:29 +0100 Subject: Fixed a theoretical memory leak with no practical effects in ae_kqueue.c and ae_epoll.c, thanks to magicyang87 for reporting it. --- src/ae_kqueue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ae_kqueue.c') 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; -- cgit v1.2.1