Fix memory leaks

This commit is contained in:
valentino 2019-01-20 16:07:55 +02:00 committed by Mark Nunberg
parent 58222c26f4
commit 847a20122f
2 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ static void redisLibeventHandler(int fd, short event, void *arg) {
if (event & EV_TIMEOUT) {
redisAsyncHandleTimeout(e->context);
}
if (e->context && (event & EV_READ)) {
if ((event & EV_READ) && e->context) {
redisAsyncHandleRead(e->context);
}
if (e->context && (event & EV_WRITE)) {
if ((event & EV_WRITE) && e->context) {
redisAsyncHandleWrite(e->context);
}
}
@ -107,7 +107,6 @@ static void redisLibeventSetTimeout(void *privdata, struct timeval tv) {
short flags = e->flags;
e->flags = 0;
e->tv = tv;
event_del(e->ev);
redisLibeventUpdate(e, flags, 0);
}

View File

@ -618,6 +618,7 @@ void redisFree(redisContext *c) {
if (c->ssl) {
redisFreeSsl(c->ssl);
}
free(c);
}
int redisFreeKeepFd(redisContext *c) {