hiredis/Fix-memory-leak.patch
zhangxingrong 606ca76892 add some upstream patchs
(cherry picked from commit 3ea9b8da7821fd4eb273a89893a9e4a81d1d9358)
2024-08-13 15:43:05 +08:00

25 lines
746 B
Diff

From 0084435a5fdfdd478bae1d2118bfd0ed37851ace Mon Sep 17 00:00:00 2001
From: Mark Agranat <agranatmarkit@gmail.com>
Date: Tue, 14 Nov 2023 23:53:25 +0100
Subject: [PATCH] Fix memory leak.
When redisLibuvAttach receives error from call to
uv_poll_init_socket there is a memory leaked ptr
of type redisLibuvEvents.
---
adapters/libuv.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/adapters/libuv.h b/adapters/libuv.h
index 268edab79..ec67c15a2 100644
--- a/adapters/libuv.h
+++ b/adapters/libuv.h
@@ -159,6 +159,7 @@ static int redisLibuvAttach(redisAsyncContext* ac, uv_loop_t* loop) {
memset(p, 0, sizeof(*p));
if (uv_poll_init_socket(loop, &p->handle, c->fd) != 0) {
+ hi_free(p);
return REDIS_ERR;
}