From 3f383908e2ee0268ac48de3f953a2f099614d74f Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sun, 2 Nov 2014 16:00:28 -0500 Subject: [PATCH] Properly clean up on ssl_cert_dup failure. Caught by scan-build. Change-Id: I7c09b176d6a9e5d4fcd6e4fba184ac0679983cff Reviewed-on: https://boringssl-review.googlesource.com/2200 Reviewed-by: Adam Langley --- ssl/ssl_cert.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 33f3fd87..3d56da65 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -361,13 +361,7 @@ CERT *ssl_cert_dup(CERT *cert) return(ret); err: - if (ret->dh_tmp != NULL) - DH_free(ret->dh_tmp); - if (ret->ecdh_tmp != NULL) - EC_KEY_free(ret->ecdh_tmp); - - ssl_cert_clear_certs(ret); - + ssl_cert_free(ret); return NULL; }