From cedec11acf73d4a92a70f91cf705106662687d10 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 17 Feb 2024 23:22:56 +0000 Subject: [PATCH] sapi/fpm: little simplification for the kqueue backend. --- sapi/fpm/fpm/events/kqueue.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sapi/fpm/fpm/events/kqueue.c b/sapi/fpm/fpm/events/kqueue.c index b81650d7741..1204a75ae1a 100644 --- a/sapi/fpm/fpm/events/kqueue.c +++ b/sapi/fpm/fpm/events/kqueue.c @@ -79,14 +79,12 @@ static int fpm_event_kqueue_init(int max) /* {{{ */ return -1; } - kevents = malloc(sizeof(struct kevent) * max); + kevents = calloc(max, sizeof(struct kevent)); if (!kevents) { zlog(ZLOG_ERROR, "epoll: unable to allocate %d events", max); return -1; } - memset(kevents, 0, sizeof(struct kevent) * max); - nkevents = max; return 0;