diff options
author | valentino <valentino@redislabs.com> | 2019-02-19 19:17:41 +0200 |
---|---|---|
committer | Mark Nunberg <mnunberg@haskalah.org> | 2019-02-20 09:11:10 -0500 |
commit | d9e0299f1cf923ebba0e2027a2044954c5a22a38 (patch) | |
tree | b2d10b0358f25c6851cf84d6e76b701e12c84685 /adapters/libevent.h | |
parent | 271f33953ff75f32d100714ae9ea2a666bca6469 (diff) |
fix redisLibeventEvents init
Diffstat (limited to 'adapters/libevent.h')
-rw-r--r-- | adapters/libevent.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/adapters/libevent.h b/adapters/libevent.h index 1c86c15..a495277 100644 --- a/adapters/libevent.h +++ b/adapters/libevent.h @@ -39,7 +39,7 @@ typedef struct redisLibeventEvents { redisAsyncContext *context; - struct event *ev, *tmr; + struct event *ev; struct event_base *base; struct timeval tv; short flags; @@ -152,7 +152,7 @@ static int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { return REDIS_ERR; /* Create container for context and r/w events */ - e = (redisLibeventEvents*)malloc(sizeof(*e)); + e = (redisLibeventEvents*)calloc(1, sizeof(*e)); e->context = ac; /* Register functions to start/stop listening for events */ @@ -166,10 +166,7 @@ static int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { /* Initialize and install read/write events */ e->ev = event_new(base, c->fd, EV_READ | EV_WRITE, redisLibeventHandler, e); - e->flags = 0; e->base = base; - e->tv.tv_sec = 0; - e->tv.tv_usec = 0; return REDIS_OK; } #endif |