Use a consistent size as the parameter for the *alloc family.
---
 src/ev_evports.c | 2 +-
 src/hlua.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ev_evports.c b/src/ev_evports.c
index 710d51236..73e97517c 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 086a8e0be..c2e56b3b9 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));
-- 
2.33.1


Reply via email to