From 14f802b360ef52141c83d477ac626cc6622e4eda Mon Sep 17 00:00:00 2001 From: Binbin Date: Fri, 7 Jul 2023 21:40:44 +0800 Subject: [PATCH] Initialize cluster owner_not_claiming_slot to avoid warning (#12391) valgrind report a Uninitialised warning: ``` ==25508== Uninitialised value was created by a heap allocation ==25508== at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==25508== by 0x1A35A1: ztrymalloc_usable_internal (zmalloc.c:117) ==25508== by 0x1A368D: zmalloc (zmalloc.c:145) ==25508== by 0x21FDEA: clusterInit (cluster.c:973) ==25508== by 0x19DC09: main (server.c:7306) ``` Introduced in #12344 --- src/cluster.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index a390585f3e6c..9e4cfd2730ab 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -998,6 +998,8 @@ void clusterInit(void) { memset(server.cluster->slots,0, sizeof(server.cluster->slots)); clusterCloseAllSlots(); + memset(server.cluster->owner_not_claiming_slot, 0, sizeof(server.cluster->owner_not_claiming_slot)); + /* Lock the cluster config file to make sure every node uses * its own nodes.conf. */ server.cluster_config_file_lock_fd = -1;