Don't retry outgoing connections if node is connected
[tinc] / src / connection.c
index 16878ea..4f8d4fd 100644 (file)
@@ -58,7 +58,7 @@ connection_t *new_connection(void) {
 }
 
 #ifndef DISABLE_LEGACY
-bool init_crypto_by_nid(legacy_crypto_t *c, int cipher, int digest) {
+bool init_crypto_by_nid(legacy_crypto_t *c, nid_t cipher, nid_t digest) {
        if(!cipher_open_by_nid(&c->cipher, cipher)) {
                return false;
        }
@@ -148,7 +148,8 @@ void free_connection(connection_t *c) {
        free(c->hostname);
 
        if(c->config_tree) {
-               exit_configuration(&c->config_tree);
+               exit_configuration(c->config_tree);
+               c->config_tree = NULL;
        }
 
        free(c);