From: Adriaan de Jong Date: Tue, 5 Jul 2011 09:41:14 +0000 (+0200) Subject: Removed stray X509_free from ssl.c X-Git-Tag: v2.3-alpha1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477127061a22e6e998755c657873aa1b212ea59a;p=thirdparty%2Fopenvpn.git Removed stray X509_free from ssl.c Signed-off-by: Adriaan de Jong Acked-by: James Yonan Signed-off-by: David Sommerseth --- diff --git a/ssl.c b/ssl.c index e2f081079..36891c221 100644 --- a/ssl.c +++ b/ssl.c @@ -350,7 +350,7 @@ init_ssl (const struct options *options, struct tls_root_ctx *new_ctx) &my_cert); tls_ctx_use_external_private_key(new_ctx, my_cert); - X509_free(my_cert); + tls_ctx_free_cert_file(my_cert); } #endif else diff --git a/ssl_backend.h b/ssl_backend.h index b67421c56..243c9e362 100644 --- a/ssl_backend.h +++ b/ssl_backend.h @@ -196,6 +196,13 @@ void tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file, x509_cert_t **x509 ); +/** + * Free the given certificate + * + * @param x509 certificate to free + */ +void tls_ctx_free_cert_file (x509_cert_t *x509); + /** * Load private key file into the given TLS context. * diff --git a/ssl_openssl.c b/ssl_openssl.c index f36b31943..ebea63642 100644 --- a/ssl_openssl.c +++ b/ssl_openssl.c @@ -431,6 +431,12 @@ tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file, } } +void +tls_ctx_free_cert_file (X509 *x509) +{ + X509_free(x509); +} + #if ENABLE_INLINE_FILES static int use_inline_PrivateKey_file (SSL_CTX *ctx, const char *key_string) diff --git a/ssl_polarssl.c b/ssl_polarssl.c index 2731081e0..128e75d05 100644 --- a/ssl_polarssl.c +++ b/ssl_polarssl.c @@ -262,6 +262,12 @@ tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file, } } +void +tls_ctx_free_cert_file (x509_cert_t *x509) +{ + x509_free(x509); +} + int tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file #if ENABLE_INLINE_FILES