use calloc in init

This commit is contained in:
ruti 2024-05-04 17:11:04 +03:00
parent e1b952cef6
commit 714e4c98fe

View File

@ -8,12 +8,13 @@
struct poolhd *init_pool(int count) struct poolhd *init_pool(int count)
{ {
struct poolhd *pool = malloc(sizeof(struct poolhd)); struct poolhd *pool = calloc(sizeof(struct poolhd), 0);
if (!pool) { if (!pool) {
return 0; return 0;
} }
pool->max = count; pool->max = count;
pool->count = 0; pool->count = 0;
pool->iters = 0;
#ifndef NOEPOLL #ifndef NOEPOLL
int efd = epoll_create(count); int efd = epoll_create(count);