Skip to content

Commit

Permalink
Initialize cluster owner_not_claiming_slot to avoid warning (#12391)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
enjoy-binbin committed Jul 7, 2023
1 parent aefdc57 commit 14f802b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cluster.c
Expand Up @@ -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;
Expand Down

0 comments on commit 14f802b

Please sign in to comment.