Skip to content

Commit cc934d0

Browse files
authored
sapi/fpm: little simplification for the kqueue backend. (#13423)
1 parent 60518e9 commit cc934d0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sapi/fpm/fpm/events/kqueue.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@ static int fpm_event_kqueue_init(int max) /* {{{ */
7979
return -1;
8080
}
8181

82-
kevents = malloc(sizeof(struct kevent) * max);
82+
kevents = calloc(max, sizeof(struct kevent));
8383
if (!kevents) {
8484
zlog(ZLOG_ERROR, "epoll: unable to allocate %d events", max);
8585
return -1;
8686
}
8787

88-
memset(kevents, 0, sizeof(struct kevent) * max);
89-
9088
nkevents = max;
9189

9290
return 0;

0 commit comments

Comments
 (0)