]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: Re-apply xalloc_size.cocci
authorTim Duesterhus <tim@bastelstu.be>
Sat, 6 Nov 2021 14:14:45 +0000 (15:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 8 Nov 2021 07:05:39 +0000 (08:05 +0100)
Use a consistent size as the parameter for the *alloc family.

src/ev_evports.c
src/hlua.c

index 710d512367d7bd662d49a4864d7d1bc1ee9b519d..73e97517cb34988a6baad32732828af757bda7c8 100644 (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;
        }
index 086a8e0be5e7f9e20016e0458c452461421583df..c2e56b3b945f8648be3c670f787613fb630368d7 100644 (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));