From 7fc00d4cbe87206eea3ff5a8d12908c8c942f045 Mon Sep 17 00:00:00 2001 From: James Yonan Date: Mon, 13 Dec 2010 09:27:08 +0000 Subject: Misc fixes to r6708. Fixed issue where "signal SIGTERM" entered from the management interface might get subsequently downgraded to a SIGUSR1. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@6716 e7ae566f-a301-0410-adde-c780ea21d3b5 --- ssl.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'ssl.c') diff --git a/ssl.c b/ssl.c index 66ee14d..9eec74e 100644 --- a/ssl.c +++ b/ssl.c @@ -1667,6 +1667,8 @@ use_certificate_file(SSL_CTX *ctx, const char *file, int type, X509 **x509) BIO_free(in); if (x509) *x509 = x; + else if (x) + X509_free (x); return(ret); } @@ -1799,12 +1801,12 @@ use_inline_certificate_file (SSL_CTX *ctx, const char *cert_string, X509 **x509) ret = SSL_CTX_use_certificate(ctx, x); end: - if (x) - X509_free (x); if (in) BIO_free (in); if (x509) *x509 = x; + else if (x) + X509_free (x); return ret; } @@ -2167,17 +2169,19 @@ init_ssl (const struct options *options) msg (M_SSLERR, "Problem with cipher list: %s", options->cipher_list); } + done: ERR_clear_error (); - + if (my_cert) + X509_free(my_cert); return ctx; err: - ERR_clear_error (); - if (my_cert) - X509_free(my_cert); if (ctx) - SSL_CTX_free (ctx); - return NULL; + { + SSL_CTX_free (ctx); + ctx = NULL; + } + goto done; } /* -- cgit v1.2.3