From de5aa838dd1003f6c71f7380eb9b3c79fda63a9e Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 Sep 2016 14:11:17 +0200 Subject: [PATCH] Clear child data when opening the pipes. This is important both to reset the magic to 0, so that it will not match if the structure is not explicitly set, and to initialize other things we may add like counters and such. --- src/childinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/childinfo.c b/src/childinfo.c index 123c20421..719025e8c 100644 --- a/src/childinfo.c +++ b/src/childinfo.c @@ -40,6 +40,8 @@ void openChildInfoPipe(void) { closeChildInfoPipe(); } else if (anetNonBlock(NULL,server.child_info_pipe[0]) != ANET_OK) { closeChildInfoPipe(); + } else { + memset(&server.child_info_data,0,sizeof(server.child_info_data)); } }