Skip to content

Commit

Permalink
Merge pull request #171 from donaldsharp/double_free
Browse files Browse the repository at this point in the history
lib: Don't use malloc!
  • Loading branch information
rwestphal authored Feb 7, 2017
2 parents 1b4ae82 + f0d975f commit 62fb7b1
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 = XCALLOC (MTYPE_THREAD_MASTER,
sizeof (struct pollfd) * rv->handler.pfdsize);
#endif
return rv;
}
Expand Down

0 comments on commit 62fb7b1

Please sign in to comment.