CLEANUP: Re-apply xalloc_size.cocci

Use a consistent size as the parameter for the *alloc family.
This commit is contained in:
Tim Duesterhus 2021-11-06 15:14:45 +01:00 committed by Willy Tarreau
parent 4c8f75fc31
commit 16cc16dd82
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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));