aboutsummaryrefslogtreecommitdiff
path: root/ssl.c
diff options
context:
space:
mode:
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 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;
}
/*