It also cleans up more when stopping tinc, helping tools like valgrind.
if(c->outkey)
free(c->outkey);
+ if(c->inctx) {
+ EVP_CIPHER_CTX_cleanup(c->inctx);
+ free(c->inctx);
+ }
+
+ if(c->outctx) {
+ EVP_CIPHER_CTX_cleanup(c->outctx);
+ free(c->outctx);
+ }
+
if(c->mychallenge)
free(c->mychallenge);
if(c->hischallenge)
free(c->hischallenge);
+ if(c->config_tree)
+ exit_configuration(&c->config_tree);
+
+ if(c->outbuf)
+ free(c->outbuf);
+
+ if(c->rsa_key)
+ RSA_free(c->rsa_key);
+
free(c);
}
remove_pid(pidfilename);
#endif
+ if (identname) free(identname);
+ if (netname) free(netname);
+ if (pidfilename) free(pidfilename);
+ if (logfilename) free(logfilename);
+ if (myport) free(myport);
+ if (device) free(device);
+ if (confbase) free(confbase);
+
EVP_cleanup();
+ ENGINE_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+ ERR_remove_state(0);
+ ERR_free_strings();
return status;
}