CLEANUP: Re-apply xalloc_size.cocci
Use a consistent size as the parameter for the *alloc family.
This commit is contained in:
parent
4c8f75fc31
commit
16cc16dd82
|
@ -293,7 +293,7 @@ static int init_evports_per_thread()
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
evports_evlist_max = global.tune.maxpollevents;
|
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) {
|
if (evports_evlist == NULL) {
|
||||||
goto fail_alloc;
|
goto fail_alloc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7089,7 +7089,7 @@ struct http_hdr *hlua_httpclient_table_to_hdrs(lua_State *L)
|
||||||
|
|
||||||
if (hdr_num) {
|
if (hdr_num) {
|
||||||
/* alloc and copy the headers in the httpclient struct */
|
/* 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)
|
if (!result)
|
||||||
goto skip_headers;
|
goto skip_headers;
|
||||||
memcpy(result, hdrs, sizeof(struct http_hdr) * (hdr_num + 1));
|
memcpy(result, hdrs, sizeof(struct http_hdr) * (hdr_num + 1));
|
||||||
|
|
Loading…
Reference in New Issue