aboutsummaryrefslogtreecommitdiff
path: root/ssl.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2010-12-13 09:27:08 +0000
committerJames Yonan <james@openvpn.net>2010-12-13 09:27:08 +0000
commitae1884c0cbf42c21e54922c150cde44c43200340 (patch)
tree1e6d88d1b07106618ed92e69c68f876658664bc1 /ssl.c
parentMinor addition of logging info before and after (diff)
downloadopenvpn-ae1884c0cbf42c21e54922c150cde44c43200340.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 'ssl.c')
-rw-r--r--ssl.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/ssl.c b/ssl.c
index 9ab907c..817ea9d 100644
--- a/ssl.c
+++ b/ssl.c
@@ -1500,6 +1500,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);
}
@@ -1632,12 +1634,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;
}
@@ -1995,17 +1997,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;
}
/*