diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2015-06-21 18:17:09 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2015-06-21 18:17:09 +0100 |
commit | 152e7604f63fcaebcf01efda0a9aae33127eb369 (patch) | |
tree | 3bbe1b392a85a50233313ace68168bbdea73e713 /src/src/tlscert-gnu.c | |
parent | 658cb1162748378988f8086520e7e22eb9569bf3 (diff) | |
download | exim4-152e7604f63fcaebcf01efda0a9aae33127eb369.tar.gz |
Before importing a certificate, free any previous one. Bug 1648
Because the SSL libraries do not use Exim's heap management
this was a memory-leak in "exim -bp".
Diffstat (limited to 'src/src/tlscert-gnu.c')
-rw-r--r-- | src/src/tlscert-gnu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/src/tlscert-gnu.c b/src/src/tlscert-gnu.c index dc290b8b7..40f49d366 100644 --- a/src/src/tlscert-gnu.c +++ b/src/src/tlscert-gnu.c @@ -51,10 +51,14 @@ tls_import_cert(const uschar * buf, void ** cert) { 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); |