Skip to content

Commit 2706c3e

Browse files
AgranatMarkitmichael-grunder
authored andcommitted
Fix memory leak.
When redisLibuvAttach receives error from call to uv_poll_init_socket there is a memory leaked ptr of type redisLibuvEvents.
1 parent ff7a064 commit 2706c3e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

adapters/libuv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ static int redisLibuvAttach(redisAsyncContext* ac, uv_loop_t* loop) {
159159
memset(p, 0, sizeof(*p));
160160

161161
if (uv_poll_init_socket(loop, &p->handle, c->fd) != 0) {
162+
hi_free(p);
162163
return REDIS_ERR;
163164
}
164165

0 commit comments

Comments
 (0)