mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-16 13:56:47 +00:00
Merge pull request #171 from donaldsharp/double_free
lib: Don't use malloc!
This commit is contained in:
commit
62fb7b19e8
@ -489,8 +489,8 @@ thread_master_create (void)
|
|||||||
#if defined(HAVE_POLL)
|
#if defined(HAVE_POLL)
|
||||||
rv->handler.pfdsize = rv->fd_limit;
|
rv->handler.pfdsize = rv->fd_limit;
|
||||||
rv->handler.pfdcount = 0;
|
rv->handler.pfdcount = 0;
|
||||||
rv->handler.pfds = (struct pollfd *) malloc (sizeof (struct pollfd) * rv->handler.pfdsize);
|
rv->handler.pfds = XCALLOC (MTYPE_THREAD_MASTER,
|
||||||
memset (rv->handler.pfds, 0, sizeof (struct pollfd) * rv->handler.pfdsize);
|
sizeof (struct pollfd) * rv->handler.pfdsize);
|
||||||
#endif
|
#endif
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user