Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto/ec
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-03-09 00:04:50 +0300
committerDavid Benjamin <davidben@google.com>2016-03-09 00:08:48 +0300
commit3d38c03a8e2011e1d2801c389fc481c8ba9841d6 (patch)
treeee87510b76d2354a0d92d2ce1665194a4d1349a9 /crypto/ec
parentf945952d5779bf7e2b38297cad29d1efb61f5911 (diff)
Fix a few more missing CBB_cleanups.
See also 1b0c438e1a0e570de18ecc7aabda3be8dea4cfa0. Change-Id: Ifcfe15caa4d0db8ef725f8dacd0e8c5c94b00a09 Reviewed-on: https://boringssl-review.googlesource.com/7390 Reviewed-by: Emily Stark (Dunn) <estark@google.com> Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_asn1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index a29a2dcf..0535a79f 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -401,6 +401,7 @@ int i2d_ECPrivateKey(const EC_KEY *key, uint8_t **outp) {
CBB cbb;
if (!CBB_init(&cbb, 0) ||
!EC_KEY_marshal_private_key(&cbb, key, EC_KEY_get_enc_flags(key))) {
+ CBB_cleanup(&cbb);
return -1;
}
return CBB_finish_i2d(&cbb, outp);
@@ -449,6 +450,7 @@ int i2d_ECParameters(const EC_KEY *key, uint8_t **outp) {
CBB cbb;
if (!CBB_init(&cbb, 0) ||
!OBJ_nid2cbb(&cbb, curve_nid)) {
+ CBB_cleanup(&cbb);
return -1;
}
return CBB_finish_i2d(&cbb, outp);