mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
CLEANUP: Apply xalloc_size.cocci
This fixes a few locations with a hardcoded type within `sizeof()`.
This commit is contained in:
parent
02fa646a37
commit
ec4a8754da
@ -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,
|
static inline struct bind_conf *bind_conf_alloc(struct proxy *fe, const char *file,
|
||||||
int line, const char *arg, struct xprt_ops *xprt)
|
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)
|
if (!bind_conf)
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -126,7 +126,7 @@ static void generate_usermsgs_ctx_str(void)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (unlikely(b_is_null(&ctx->str))) {
|
if (unlikely(b_is_null(&ctx->str))) {
|
||||||
area = calloc(USERMSGS_CTX_BUFSIZE, sizeof(char));
|
area = calloc(USERMSGS_CTX_BUFSIZE, sizeof(*area));
|
||||||
if (area)
|
if (area)
|
||||||
ctx->str = b_make(area, USERMSGS_CTX_BUFSIZE, 0, 0);
|
ctx->str = b_make(area, USERMSGS_CTX_BUFSIZE, 0, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user