summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-02 00:53:47 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-02 00:53:47 +0200
commit546ac7936340312cf272969ff83317ae4d50d2b4 (patch)
tree7ecadca11430c8624d9f80aae7c348fa4d65b969 /src/fastd.c
parentb22364f4af3564f0dd9a5f4e150bb09747bd5c4e (diff)
downloadfastd-546ac7936340312cf272969ff83317ae4d50d2b4.tar
fastd-546ac7936340312cf272969ff83317ae4d50d2b4.zip
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).
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c2
1 files changed, 1 insertions, 1 deletions
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;