From 9fd69a7893040cee7339246d5b17ab92b4d58a43 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Mar 2012 23:51:41 +0200 Subject: Allow initating and accepting handshake instances to coexist; fix some memory corruption etc. found by Valgrind --- src/config.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 6f0b3cf..0b5450d 100644 --- a/src/config.c +++ b/src/config.c @@ -249,12 +249,14 @@ void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *con conf->peers = current_peer; current_peer->enabled = true; + current_peer->address.sa.sa_family = AF_UNSPEC; + current_peer->key = NULL; + current_peer->protocol_config = NULL; + memset(¤t_peer->address, 0, sizeof(fastd_peer_address)); - if (strcmp(arg, "float") == 0) { - current_peer->address.sa.sa_family = AF_UNSPEC; + if (strcmp(arg, "float") == 0) continue; - } if (arg[0] == '[') { charptr = strchr(arg, ']'); -- cgit v1.2.3