Skip to content

Commit

Permalink
lib: Don't use malloc!
Browse files Browse the repository at this point in the history
thread.c was using malloc.  This was found by the
assert added to memory.c.

Fixes issues FRRouting#170

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
  • Loading branch information
donaldsharp committed Feb 6, 2017
1 parent 1b4ae82 commit f96872f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (struct pollfd *) XCALLOC (MTYPE_THREAD_MASTER,
sizeof (struct pollfd) * rv->handler.pfdsize);
#endif
return rv;
}
Expand Down

0 comments on commit f96872f

Please sign in to comment.