From cc934d048c4f77452e4441b1bef7ac40e4c0d059 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 18 Feb 2024 15:01:41 +0000 Subject: [PATCH] sapi/fpm: little simplification for the kqueue backend. (#13423) --- 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;