51 |
xfree(rm.gpg_file); |
xfree(rm.gpg_file); |
52 |
xfree(rm.latent_time); |
xfree(rm.latent_time); |
53 |
|
|
54 |
#if defined(HAVE_TLS) || defined(HAVE_SSL) |
#if defined(HAVE_TLS) || defined(HAVE_SSL) |
55 |
xfree(secure.cafile); |
xfree(secure.cafile); |
56 |
xfree(secure.cert); |
xfree(secure.cert); |
57 |
xfree(secure.key); |
xfree(secure.key); |
58 |
#endif /* HAVE_TLS or HAVE_SSL */ |
#endif /* HAVE_TLS or HAVE_SSL */ |
59 |
|
|
60 |
#ifdef HAVE_GPG |
#ifdef HAVE_GPG |
61 |
xfree(gpg.keys); |
xfree(gpg.keys); |
62 |
xfree(gpg.rm_key); |
xfree(gpg.rm_key); |
63 |
if (gpg.passphrase) { |
if (gpg.passphrase) { |
64 |
memset(gpg.passphrase, 0, strlen(gpg.passphrase)); |
memset(gpg.passphrase, 0, strlen(gpg.passphrase)); |
65 |
xfree(gpg.passphrase); |
xfree(gpg.passphrase); |
66 |
} |
} |
67 |
#endif /* HAVE_GPG */ |
#endif /* HAVE_GPG */ |
68 |
|
|
69 |
destroy_list(&session.transmap); |
destroy_list(&session.transmap); |
70 |
xfree(options.slogfile); |
xfree(options.slogfile); |
71 |
xfree(options.ulogfile); |
xfree(options.ulogfile); |
72 |
xfree(session.execpath); |
xfree(session.execpath); |
73 |
if (topt & T_RCEXECARGS) { |
xfree_pptr(session.execargs); |
|
xfree_pptr(session.execargs); |
|
|
topt &= ~T_RCEXECARGS; |
|
|
} |
|
74 |
xfree_pptr(submatch); |
xfree_pptr(submatch); |
75 |
return; |
return; |
76 |
} |
} |
81 |
memset(session.mta_username, 0, sizeof(session.mta_username)); |
memset(session.mta_username, 0, sizeof(session.mta_username)); |
82 |
memset(session.mta_password, 0, sizeof(session.mta_password)); |
memset(session.mta_password, 0, sizeof(session.mta_password)); |
83 |
|
|
84 |
#ifdef HAVE_TLS |
#ifdef HAVE_TLS |
85 |
end_tls(CLIENT, secure.client); |
end_tls(CLIENT, secure.client); |
86 |
end_tls(SERVER, secure.server); |
end_tls(SERVER, secure.server); |
87 |
if (secure.xcred) |
if (secure.xcred) |
89 |
if (secure.x509_cred) |
if (secure.x509_cred) |
90 |
gnutls_certificate_free_credentials(secure.x509_cred); |
gnutls_certificate_free_credentials(secure.x509_cred); |
91 |
gnutls_global_deinit(); |
gnutls_global_deinit(); |
92 |
#endif /* HAVE_TLS */ |
#endif /* HAVE_TLS */ |
93 |
|
|
94 |
#ifdef HAVE_SSL |
#ifdef HAVE_SSL |
95 |
end_ssl(CLIENT, secure.client, secure.ctx_client); |
end_ssl(CLIENT, secure.client, secure.ctx_client); |
96 |
end_ssl(SERVER, secure.server, secure.ctx_server); |
end_ssl(SERVER, secure.server, secure.ctx_server); |
97 |
#endif /* HAVE_SSL */ |
#endif /* HAVE_SSL */ |
98 |
|
|
99 |
#ifdef HAVE_SYSLOG |
#ifdef HAVE_SYSLOG |
100 |
if ((topt & T_DAEMON) && !(topt & T_FOREGROUND)) |
if ((topt & T_DAEMON) && !(topt & T_FOREGROUND)) |
101 |
closelog(); |
closelog(); |
102 |
#endif /* HAVE_SYSLOG */ |
#endif /* HAVE_SYSLOG */ |
103 |
|
|
104 |
free_mem(); |
free_mem(); |
105 |
exit(code); |
exit(code); |