diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-17 21:31:29 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-07-17 21:31:29 +0200 |
commit | 1812a63c043b219277441bae1f36a99a5b7b5899 (patch) | |
tree | ba7101843ca8da55b5ca3b85a32203f180b25f74 /src | |
parent | 88a634990ddb781bb5e24c0f33fcd0e5d59d37a6 (diff) | |
download | fastd-1812a63c043b219277441bae1f36a99a5b7b5899.tar fastd-1812a63c043b219277441bae1f36a99a5b7b5899.zip |
Use calloc to allocate peer configs
Diffstat (limited to 'src')
-rw-r--r-- | src/peer.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -213,19 +213,9 @@ static void delete_peer(fastd_context_t *ctx, fastd_peer_t *peer) { fastd_peer_config_t* fastd_peer_config_new(fastd_context_t *ctx, fastd_config_t *conf) { - fastd_peer_config_t *peer = malloc(sizeof(fastd_peer_config_t)); - peer->enabled = false; + fastd_peer_config_t *peer = calloc(1, sizeof(fastd_peer_config_t)); - peer->hostname = NULL; - memset(&peer->address, 0, sizeof(fastd_peer_address_t)); - peer->dynamic_float = false; - - peer->config_source_dir = NULL; - - peer->name = NULL; - peer->key = NULL; peer->group = conf->peer_group; - peer->protocol_config = NULL; peer->next = conf->peers; conf->peers = peer; |