diff --git a/admin/halog/halog.c b/admin/halog/halog.c index f2b9dd7e7..884a606e8 100644 --- a/admin/halog/halog.c +++ b/admin/halog/halog.c @@ -410,7 +410,7 @@ struct timer *insert_timer(struct eb_root *r, struct timer **alloc, int v) struct eb32_node *n; if (!t) { - t = calloc(sizeof(*t), 1); + t = calloc(1, sizeof(*t)); if (unlikely(!t)) { fprintf(stderr, "%s: not enough memory\n", __FUNCTION__); exit(1); @@ -438,7 +438,7 @@ struct timer *insert_value(struct eb_root *r, struct timer **alloc, int v) struct eb32_node *n; if (!t) { - t = calloc(sizeof(*t), 1); + t = calloc(1, sizeof(*t)); if (unlikely(!t)) { fprintf(stderr, "%s: not enough memory\n", __FUNCTION__); exit(1); diff --git a/dev/udp/udp-perturb.c b/dev/udp/udp-perturb.c index 8a851fc49..55d177343 100644 --- a/dev/udp/udp-perturb.c +++ b/dev/udp/udp-perturb.c @@ -489,7 +489,7 @@ int main(int argc, char **argv) if (addr_to_ss(argv[optind+1], &srv_addr, &err) < 0) die(1, "parsing server address: %s\n", err.msg); - pfd = calloc(sizeof(struct pollfd), MAXCONN + 1); + pfd = calloc(MAXCONN + 1, sizeof(struct pollfd)); if (!pfd) die(1, "out of memory\n"); diff --git a/src/debug.c b/src/debug.c index e69a82743..d1526e1d4 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1293,7 +1293,7 @@ static int debug_parse_delay_inj(char **args, char *payload, struct appctx *appc _HA_ATOMIC_INC(&debug_commands_issued); - tctx = calloc(sizeof(*tctx), 2); + tctx = calloc(2, sizeof(*tctx)); if (!tctx) goto fail; @@ -1427,7 +1427,7 @@ static int debug_parse_cli_sched(char **args, char *payload, struct appctx *appc *(uint8_t *)ptr = new; } - tctx = calloc(sizeof(*tctx), count + 2); + tctx = calloc(count + 2, sizeof(*tctx)); if (!tctx) goto fail;