summaryrefslogtreecommitdiff
path: root/adapters/ae.h
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/ae.h')
-rw-r--r--adapters/ae.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/adapters/ae.h b/adapters/ae.h
index 0393992..660d82e 100644
--- a/adapters/ae.h
+++ b/adapters/ae.h
@@ -96,7 +96,7 @@ static void redisAeCleanup(void *privdata) {
redisAeEvents *e = (redisAeEvents*)privdata;
redisAeDelRead(privdata);
redisAeDelWrite(privdata);
- free(e);
+ hi_free(e);
}
static int redisAeAttach(aeEventLoop *loop, redisAsyncContext *ac) {
@@ -109,6 +109,9 @@ static int redisAeAttach(aeEventLoop *loop, redisAsyncContext *ac) {
/* Create container for context and r/w events */
e = (redisAeEvents*)hi_malloc(sizeof(*e));
+ if (e == NULL)
+ return REDIS_ERR;
+
e->context = ac;
e->loop = loop;
e->fd = c->fd;