mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-27 13:51:00 +01:00
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:
parent
9001ce8c2f
commit
f3a86831ae
@ -1599,7 +1599,7 @@ static void init(int argc, char **argv)
|
|||||||
|
|
||||||
if (getenv("HAPROXY_MWORKER_REEXEC") == NULL) {
|
if (getenv("HAPROXY_MWORKER_REEXEC") == NULL) {
|
||||||
|
|
||||||
tmproc = malloc(sizeof(*tmproc));
|
tmproc = calloc(1, sizeof(*tmproc));
|
||||||
if (!tmproc) {
|
if (!tmproc) {
|
||||||
ha_alert("Cannot allocate process structures.\n");
|
ha_alert("Cannot allocate process structures.\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
@ -1619,7 +1619,7 @@ static void init(int argc, char **argv)
|
|||||||
|
|
||||||
for (proc = 0; proc < global.nbproc; proc++) {
|
for (proc = 0; proc < global.nbproc; proc++) {
|
||||||
|
|
||||||
tmproc = malloc(sizeof(*tmproc));
|
tmproc = calloc(1, sizeof(*tmproc));
|
||||||
if (!tmproc) {
|
if (!tmproc) {
|
||||||
ha_alert("Cannot allocate process structures.\n");
|
ha_alert("Cannot allocate process structures.\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user