From ec4a8754da59e00b6313dbc10a081badfb37bf33 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Wed, 15 Sep 2021 13:58:46 +0200 Subject: [PATCH] CLEANUP: Apply xalloc_size.cocci This fixes a few locations with a hardcoded type within `sizeof()`. --- include/haproxy/listener.h | 2 +- src/errors.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/haproxy/listener.h b/include/haproxy/listener.h index 1c37d34..2212ca9 100644 --- a/include/haproxy/listener.h +++ b/include/haproxy/listener.h @@ -179,7 +179,7 @@ unsigned int bind_map_thread_id(const struct bind_conf *conf, unsigned int r); static inline struct bind_conf *bind_conf_alloc(struct proxy *fe, const char *file, int line, const char *arg, struct xprt_ops *xprt) { - struct bind_conf *bind_conf = calloc(1, sizeof(struct bind_conf)); + struct bind_conf *bind_conf = calloc(1, sizeof(*bind_conf)); if (!bind_conf) goto err; diff --git a/src/errors.c b/src/errors.c index d2eafce..993b6ae 100644 --- a/src/errors.c +++ b/src/errors.c @@ -126,7 +126,7 @@ static void generate_usermsgs_ctx_str(void) int ret; if (unlikely(b_is_null(&ctx->str))) { - area = calloc(USERMSGS_CTX_BUFSIZE, sizeof(char)); + area = calloc(USERMSGS_CTX_BUFSIZE, sizeof(*area)); if (area) ctx->str = b_make(area, USERMSGS_CTX_BUFSIZE, 0, 0); } -- 1.7.10.4