summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-17 21:31:29 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-17 21:31:29 +0200
commit1812a63c043b219277441bae1f36a99a5b7b5899 (patch)
treeba7101843ca8da55b5ca3b85a32203f180b25f74 /src/peer.c
parent88a634990ddb781bb5e24c0f33fcd0e5d59d37a6 (diff)
downloadfastd-1812a63c043b219277441bae1f36a99a5b7b5899.tar
fastd-1812a63c043b219277441bae1f36a99a5b7b5899.zip
Use calloc to allocate peer configs
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c12
1 files changed, 1 insertions, 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;