diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-02 00:53:47 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-02 00:53:47 +0200 |
commit | 546ac7936340312cf272969ff83317ae4d50d2b4 (patch) | |
tree | 7ecadca11430c8624d9f80aae7c348fa4d65b969 /src/resolve.c | |
parent | b22364f4af3564f0dd9a5f4e150bb09747bd5c4e (diff) | |
download | fastd-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/resolve.c')
-rw-r--r-- | src/resolve.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolve.c b/src/resolve.c index 1020253..4ed2faf 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -125,11 +125,11 @@ void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote) { remote->last_resolve_timeout = fastd_in_seconds(MIN_RESOLVE_INTERVAL); - resolv_arg_t *arg = malloc(sizeof(resolv_arg_t)); + resolv_arg_t *arg = fastd_new(resolv_arg_t); arg->peer_id = peer->id; arg->remote = remote - VECTOR_DATA(peer->remotes); - arg->hostname = strdup(remote->config->hostname); + arg->hostname = fastd_strdup(remote->config->hostname); arg->constraints = remote->config->address; pthread_t thread; |