diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-06 12:52:28 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-02-06 12:52:28 -0500 |
| commit | f96872f001495b6ba8cd6e8ff0e4ea37f2ff0199 (patch) | |
| tree | d4e0f5957b60bdce0214464ed77e4e33fc2adf90 /lib/thread.c | |
| parent | 1b4ae82d37fe06a9e6a7cac6a67aa5fb3beb777c (diff) | |
lib: Don't use malloc!
thread.c was using malloc. This was found by the
assert added to memory.c.
Fixes issues #170
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/thread.c')
| -rw-r--r-- | lib/thread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/thread.c b/lib/thread.c index 6ada7cd96a..e4b83eaf86 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -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; } |
