diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-26 23:51:41 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-26 23:51:41 +0200 |
commit | 9fd69a7893040cee7339246d5b17ab92b4d58a43 (patch) | |
tree | e61d9ef3a40996214d7f738f642b9ac18e6bf95b /src/config.c | |
parent | 5074b7d5e10c2383a3379a6df8b0708783ac704b (diff) | |
download | fastd-9fd69a7893040cee7339246d5b17ab92b4d58a43.tar fastd-9fd69a7893040cee7339246d5b17ab92b4d58a43.zip |
Allow initating and accepting handshake instances to coexist; fix some memory corruption etc. found by Valgrind
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 8 |
1 files changed, 5 insertions, 3 deletions
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, ']'); |