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 <agl@google.com>
This commit is contained in:
David Benjamin 2014-11-02 16:00:28 -05:00 committed by Adam Langley
parent 25cb99c149
commit 3f383908e2

View File

@ -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;
}