solve valgrind warning in child_info (#8505)
Valgrind warns about `write` accessing uninitialized memory, which was the struct padding.
This commit is contained in:
parent
ae4d2fe1b3
commit
f6d1af1c07
@ -69,10 +69,11 @@ void closeChildInfoPipe(void) {
|
|||||||
void sendChildInfoGeneric(childInfoType info_type, size_t keys, double progress, char *pname) {
|
void sendChildInfoGeneric(childInfoType info_type, size_t keys, double progress, char *pname) {
|
||||||
if (server.child_info_pipe[1] == -1) return;
|
if (server.child_info_pipe[1] == -1) return;
|
||||||
|
|
||||||
child_info_data data = {.information_type=info_type,
|
child_info_data data = {0}; /* zero everything, including padding to sattisfy valgrind */
|
||||||
.keys=keys,
|
data.information_type = info_type;
|
||||||
.cow=zmalloc_get_private_dirty(-1),
|
data.keys = keys;
|
||||||
.progress=progress};
|
data.cow = zmalloc_get_private_dirty(-1);
|
||||||
|
data.progress = progress;
|
||||||
|
|
||||||
if (data.cow) {
|
if (data.cow) {
|
||||||
serverLog((info_type == CHILD_INFO_TYPE_CURRENT_INFO) ? LL_VERBOSE : LL_NOTICE,
|
serverLog((info_type == CHILD_INFO_TYPE_CURRENT_INFO) ? LL_VERBOSE : LL_NOTICE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user