From f3a86831ae505000026598ec1c51d83c2b5c14db Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Mon, 1 Apr 2019 11:29:58 +0200 Subject: [PATCH] MINOR: mworker: calloc mworker_proc structures Initialize mworker_proc structures to 0 with calloc instead of just doing a malloc. --- src/haproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 3cc5c9ca50..77efdd50c9 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1599,7 +1599,7 @@ static void init(int argc, char **argv) if (getenv("HAPROXY_MWORKER_REEXEC") == NULL) { - tmproc = malloc(sizeof(*tmproc)); + tmproc = calloc(1, sizeof(*tmproc)); if (!tmproc) { ha_alert("Cannot allocate process structures.\n"); exit(EXIT_FAILURE); @@ -1619,7 +1619,7 @@ static void init(int argc, char **argv) for (proc = 0; proc < global.nbproc; proc++) { - tmproc = malloc(sizeof(*tmproc)); + tmproc = calloc(1, sizeof(*tmproc)); if (!tmproc) { ha_alert("Cannot allocate process structures.\n"); exit(EXIT_FAILURE); -- 2.47.3