Merge pull request #171 from donaldsharp/double_free

lib: Don't use malloc!
This commit is contained in:
Renato Westphal 2017-02-07 11:48:15 -02:00 committed by GitHub
commit 62fb7b19e8

View File

@ -489,8 +489,8 @@ thread_master_create (void)
#if defined(HAVE_POLL)
rv->handler.pfdsize = rv->fd_limit;
rv->handler.pfdcount = 0;
rv->handler.pfds = (struct pollfd *) malloc (sizeof (struct pollfd) * rv->handler.pfdsize);
memset (rv->handler.pfds, 0, sizeof (struct pollfd) * rv->handler.pfdsize);
rv->handler.pfds = XCALLOC (MTYPE_THREAD_MASTER,
sizeof (struct pollfd) * rv->handler.pfdsize);
#endif
return rv;
}