From: Mukund Sivaraman <muks@banu.com>
Date: Wed, 25 Jan 2012 09:27:37 +0000 (+0100)
Subject: If aeApiCreate() fails, there's probably not much one can do, but in the name of... 
X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/caa63a382154bee2162237330e43eee2944b2c6a?ds=sidebyside

If aeApiCreate() fails, there's probably not much one can do, but in the name of consistency...
---

diff --git a/src/ae.c b/src/ae.c
index 6ddccdf7..a4037e1d 100644
--- a/src/ae.c
+++ b/src/ae.c
@@ -74,6 +74,8 @@ aeEventLoop *aeCreateEventLoop(int setsize) {
     eventLoop->maxfd = -1;
     eventLoop->beforesleep = NULL;
     if (aeApiCreate(eventLoop) == -1) {
+        zfree(eventLoop->events);
+        zfree(eventLoop->fired);
         zfree(eventLoop);
         return NULL;
     }