mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 14:25:44 +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 *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);
|
||||||
|
Loading…
Reference in New Issue
Block a user