aboutsummaryrefslogtreecommitdiff
path: root/ssl.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2010-12-13 09:27:08 +0000
committerDavid Sommerseth <davids@redhat.com>2011-03-25 09:38:48 +0100
commit7fc00d4cbe87206eea3ff5a8d12908c8c942f045 (patch)
treef912cf7fef1c9be191d2fadc0c05ac9a984da2d3 /ssl.c
parentAdded "management-external-key" option. This option can be used (diff)
downloadopenvpn-7fc00d4cbe87206eea3ff5a8d12908c8c942f045.tar.xz
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
Diffstat (limited to '')
-rw-r--r--ssl.c20
1 files changed, 12 insertions, 8 deletions
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;
}
/*