MINOR: mworker: calloc mworker_proc structures

Initialize mworker_proc structures to 0 with calloc instead of just
doing a malloc.
This commit is contained in:
William Lallemand 2019-04-01 11:29:58 +02:00 committed by Willy Tarreau
parent 9001ce8c2f
commit f3a86831ae

View File

@ -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);