From 9b305b5de54e4dd84a689e7642043253a1bbc94b Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Thu, 27 Oct 2011 09:37:27 +0200 Subject: bugfix: potential abort after reading invalid X.509 certificate closes: http://bugzilla.adiscon.com/show_bug.cgi?id=290 Signed-off-by: Rainer Gerhards --- runtime/nsd_gtls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index e1dcf870..ee78488a 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -201,10 +201,14 @@ finalize_it: if(iRet != RS_RET_OK) { if(data.data != NULL) free(data.data); - if(pThis->bOurCertIsInit) + if(pThis->bOurCertIsInit) { gnutls_x509_crt_deinit(pThis->ourCert); - if(pThis->bOurKeyIsInit) + pThis->bOurCertIsInit = 0; + } + if(pThis->bOurKeyIsInit) { gnutls_x509_privkey_deinit(pThis->ourKey); + pThis->bOurKeyIsInit = 0; + } } RETiRet; } -- cgit