Fix all -Wall -W compiler warnings.
[oweals/tinc.git] / src / tincd.c
index db6b213aa1a67fc94cdab4e4fed14f55a89dd6f5..a8b13ecb90f664f9f1a0ee15696b8aabb946fa00 100644 (file)
@@ -363,6 +363,8 @@ static bool parse_options(int argc, char **argv) {
 /* This function prettyprints the key generation process */
 
 static int indicator(int a, int b, BN_GENCB *cb) {
 /* This function prettyprints the key generation process */
 
 static int indicator(int a, int b, BN_GENCB *cb) {
+       (void)cb;
+
        switch(a) {
        case 0:
                fprintf(stderr, ".");
        switch(a) {
        case 0:
                fprintf(stderr, ".");
@@ -658,8 +660,6 @@ int main(int argc, char **argv) {
                return 1;
        }
 
                return 1;
        }
 
-       make_names();
-
        if(show_version) {
                printf("%s version %s\n", PACKAGE, VERSION);
                printf("Copyright (C) 1998-2017 Ivo Timmermans, Guus Sliepen and others.\n"
        if(show_version) {
                printf("%s version %s\n", PACKAGE, VERSION);
                printf("Copyright (C) 1998-2017 Ivo Timmermans, Guus Sliepen and others.\n"
@@ -676,6 +676,8 @@ int main(int argc, char **argv) {
                return 0;
        }
 
                return 0;
        }
 
+       make_names();
+
        if(kill_tincd) {
                return !kill_other(kill_tincd);
        }
        if(kill_tincd) {
                return !kill_other(kill_tincd);
        }
@@ -821,14 +823,8 @@ end:
        free(priority);
 
        EVP_cleanup();
        free(priority);
 
        EVP_cleanup();
-       ENGINE_cleanup();
-       CRYPTO_cleanup_all_ex_data();
-#ifdef HAVE_ERR_REMOVE_STATE
-       // OpenSSL claims this function was deprecated in 1.0.0,
-       // but valgrind's leak detector shows you still need to call it to make sure OpenSSL cleans up properly.
-       ERR_remove_state(0);
-#endif
        ERR_free_strings();
        ERR_free_strings();
+       ENGINE_cleanup();
 
        exit_configuration(&config_tree);
        list_delete_list(cmdline_conf);
 
        exit_configuration(&config_tree);
        list_delete_list(cmdline_conf);