mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 06:15:14 +00:00
use calloc in init
This commit is contained in:
parent
e1b952cef6
commit
714e4c98fe
3
conev.c
3
conev.c
@ -8,12 +8,13 @@
|
||||
|
||||
struct poolhd *init_pool(int count)
|
||||
{
|
||||
struct poolhd *pool = malloc(sizeof(struct poolhd));
|
||||
struct poolhd *pool = calloc(sizeof(struct poolhd), 0);
|
||||
if (!pool) {
|
||||
return 0;
|
||||
}
|
||||
pool->max = count;
|
||||
pool->count = 0;
|
||||
pool->iters = 0;
|
||||
|
||||
#ifndef NOEPOLL
|
||||
int efd = epoll_create(count);
|
||||
|
Loading…
Reference in New Issue
Block a user