From: William Lallemand Date: Mon, 1 Apr 2019 09:29:58 +0000 (+0200) Subject: MINOR: mworker: calloc mworker_proc structures X-Git-Tag: v2.0-dev3~348 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a86831ae505000026598ec1c51d83c2b5c14db;p=thirdparty%2Fhaproxy.git MINOR: mworker: calloc mworker_proc structures Initialize mworker_proc structures to 0 with calloc instead of just doing a malloc. --- 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);