Unverified Commit 71ab81ec authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

solve valgrind warning in child_info (#8505)

Valgrind warns about `write` accessing uninitialized memory, which was the struct padding.
parent aab479f8
...@@ -69,10 +69,11 @@ void closeChildInfoPipe(void) { ...@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment