From 1812a63c043b219277441bae1f36a99a5b7b5899 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 17 Jul 2013 21:31:29 +0200 Subject: Use calloc to allocate peer configs --- src/peer.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/peer.c b/src/peer.c index 324266a..528f560 100644 --- a/src/peer.c +++ b/src/peer.c @@ -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; -- cgit v1.2.3