From: Tim Duesterhus Date: Sat, 6 Nov 2021 14:14:45 +0000 (+0100) Subject: CLEANUP: Re-apply xalloc_size.cocci X-Git-Tag: v2.5-dev14~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=16cc16dd8235e7eb6c38b7abd210bd1e1d96b1d9;p=thirdparty%2Fhaproxy.git CLEANUP: Re-apply xalloc_size.cocci Use a consistent size as the parameter for the *alloc family. --- diff --git a/src/ev_evports.c b/src/ev_evports.c index 710d512367..73e97517cb 100644 --- a/src/ev_evports.c +++ b/src/ev_evports.c @@ -293,7 +293,7 @@ static int init_evports_per_thread() int fd; evports_evlist_max = global.tune.maxpollevents; - evports_evlist = calloc(evports_evlist_max, sizeof (port_event_t)); + evports_evlist = calloc(evports_evlist_max, sizeof(*evports_evlist)); if (evports_evlist == NULL) { goto fail_alloc; } diff --git a/src/hlua.c b/src/hlua.c index 086a8e0be5..c2e56b3b94 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -7089,7 +7089,7 @@ struct http_hdr *hlua_httpclient_table_to_hdrs(lua_State *L) if (hdr_num) { /* alloc and copy the headers in the httpclient struct */ - result = calloc((hdr_num + 1), sizeof(*hdrs)); + result = calloc((hdr_num + 1), sizeof(*result)); if (!result) goto skip_headers; memcpy(result, hdrs, sizeof(struct http_hdr) * (hdr_num + 1));