Browse code

Removed stray X509_free from ssl.c

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>

Adriaan de Jong authored on 2011/07/05 18:41:14
Showing 4 changed files
... ...
@@ -350,7 +350,7 @@ init_ssl (const struct options *options, struct tls_root_ctx *new_ctx)
350 350
 	  &my_cert);
351 351
       tls_ctx_use_external_private_key(new_ctx, my_cert);
352 352
 
353
-      X509_free(my_cert);
353
+      tls_ctx_free_cert_file(my_cert);
354 354
     }
355 355
 #endif
356 356
   else
... ...
@@ -197,6 +197,13 @@ void tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
197 197
     );
198 198
 
199 199
 /**
200
+ * Free the given certificate
201
+ *
202
+ * @param x509			certificate to free
203
+ */
204
+void tls_ctx_free_cert_file (x509_cert_t *x509);
205
+
206
+/**
200 207
  * Load private key file into the given TLS context.
201 208
  *
202 209
  * @param ctx			TLS context to use
... ...
@@ -431,6 +431,12 @@ tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
431 431
     }
432 432
 }
433 433
 
434
+void
435
+tls_ctx_free_cert_file (X509 *x509)
436
+{
437
+  X509_free(x509);
438
+}
439
+
434 440
 #if ENABLE_INLINE_FILES
435 441
 static int
436 442
 use_inline_PrivateKey_file (SSL_CTX *ctx, const char *key_string)
... ...
@@ -262,6 +262,12 @@ tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
262 262
     }
263 263
 }
264 264
 
265
+void
266
+tls_ctx_free_cert_file (x509_cert_t *x509)
267
+{
268
+  x509_free(x509);
269
+}
270
+
265 271
 int
266 272
 tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file
267 273
 #if ENABLE_INLINE_FILES