From 546ac7936340312cf272969ff83317ae4d50d2b4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Aug 2014 00:53:47 +0200 Subject: Introduce and use alloc helpers These new helpers will terminate fastd on allocation failures and add some additional convenience (allow strdup with NULL; typesafe new(type) macros). --- src/fastd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fastd.c') diff --git a/src/fastd.c b/src/fastd.c index e0d4bb2..b6e7484 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -151,7 +151,7 @@ static inline void close_log(void) { /** Initializes the configured sockets */ static void init_sockets(void) { - ctx.socks = malloc(conf.n_bind_addrs * sizeof(fastd_socket_t)); + ctx.socks = fastd_new_array(conf.n_bind_addrs, fastd_socket_t); size_t i; fastd_bind_address_t *addr = conf.bind_addrs; -- cgit v1.2.3