diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2015-08-27 23:07:07 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-08-28 11:18:04 -0400 |
commit | 55500ea7c46c27a150a46832e1260891aaad8e52 (patch) | |
tree | bf39de9a96882dedcda432923886407cdaf2adcf /crypto/asn1/x_x509a.c | |
parent | f00a10b89734e84fe80f98ad9e2e77b557c701ae (diff) | |
download | openssl-55500ea7c46c27a150a46832e1260891aaad8e52.tar.gz |
GH354: Memory leak fixes
Fix more potential leaks in X509_verify_cert()
Fix memory leak in ClientHello test
Fix memory leak in gost2814789 test
Fix potential memory leak in PKCS7_verify()
Fix potential memory leaks in X509_add1_reject_object()
Refactor to use "goto err" in cleanup.
Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'crypto/asn1/x_x509a.c')
-rw-r--r-- | crypto/asn1/x_x509a.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/asn1/x_x509a.c b/crypto/asn1/x_x509a.c index d81ccfb62f..e299b1fd50 100644 --- a/crypto/asn1/x_x509a.c +++ b/crypto/asn1/x_x509a.c @@ -172,11 +172,14 @@ int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj) if ((objtmp = OBJ_dup(obj)) == NULL) return 0; if ((aux = aux_get(x)) == NULL) - return 0; + goto err; if (aux->reject == NULL && (aux->reject = sk_ASN1_OBJECT_new_null()) == NULL) - return 0; + goto err; return sk_ASN1_OBJECT_push(aux->reject, objtmp); + err: + ASN1_OBJECT_free(objtmp); + return 0; } void X509_trust_clear(X509 *x) |