]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Removed stray X509_free from ssl.c
authorAdriaan de Jong <dejong@fox-it.com>
Tue, 5 Jul 2011 09:41:14 +0000 (11:41 +0200)
committerDavid Sommerseth <davids@redhat.com>
Sat, 22 Oct 2011 14:00:49 +0000 (16:00 +0200)
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
ssl.c
ssl_backend.h
ssl_openssl.c
ssl_polarssl.c

diff --git a/ssl.c b/ssl.c
index e2f081079f03236aed95afef738d14f563643cb8..36891c2212e396ce47cc4ec8753b1ea94b649f9a 100644 (file)
--- 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
index b67421c560b7ed40b6cd64e8741811c257344241..243c9e3626c481581b57f08599046cfb344c16a6 100644 (file)
@@ -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.
  *
index f36b31943d34b0a0799730300e3a2e0047196d3a..ebea63642376adc958a5c3c631f2ee22b22894fa 100644 (file)
@@ -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)
index 2731081e068d4f2c50781169591fc35dc0cb1791..128e75d052504dcb26b1c12b09bb4ca7a13da711 100644 (file)
@@ -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