Because the SSL libraries do not use Exim's heap management
this was a memory-leak in "exim -bp".
break;
case '2':
- addr->peercert = NULL;
if (*ptr)
(void) tls_import_cert(ptr, &addr->peercert);
+ else
+ addr->peercert = NULL;
break;
case '3':
- addr->ourcert = NULL;
if (*ptr)
(void) tls_import_cert(ptr, &addr->ourcert);
+ else
+ addr->ourcert = NULL;
break;
# ifndef DISABLE_OCSP
{
void * reset_point = store_get(0);
gnutls_datum_t datum;
-gnutls_x509_crt_t crt;
+gnutls_x509_crt_t crt = *(gnutls_x509_crt_t *)cert;
int fail = 0;
-gnutls_global_init();
+if (crt)
+ gnutls_x509_crt_deinit(crt);
+else
+ gnutls_global_init();
+
gnutls_x509_crt_init(&crt);
datum.data = string_unprinting(US buf);
void * reset_point = store_get(0);
const uschar * cp = string_unprinting(US buf);
BIO * bp;
-X509 * x;
+X509 * x = *(X509 **)cert;
int fail = 0;
+if (x) X509_free(x);
+
bp = BIO_new_mem_buf(US cp, -1);
if (!(x = PEM_read_bio_X509(bp, NULL, 0, NULL)))
{