aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/ldns/keyraw.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-12-04 23:10:49 +0200
committerRiccardo Spagni <ric@spagni.net>2014-12-04 23:10:49 +0200
commit831933425b3406310e70476dc56e822f7ae3c549 (patch)
treebd05c1b54f8cff8ef0bc1f769a22232172ec2a96 /external/unbound/ldns/keyraw.c
parentincreased version number for tagged release (diff)
downloadmonero-831933425b3406310e70476dc56e822f7ae3c549.tar.xz
update unbound from upstream
Diffstat (limited to 'external/unbound/ldns/keyraw.c')
-rw-r--r--external/unbound/ldns/keyraw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/external/unbound/ldns/keyraw.c b/external/unbound/ldns/keyraw.c
index fe650aada..1ff07742b 100644
--- a/external/unbound/ldns/keyraw.c
+++ b/external/unbound/ldns/keyraw.c
@@ -324,8 +324,10 @@ sldns_ecdsa2pkey_raw(unsigned char* key, size_t keylen, uint8_t algo)
ec = EC_KEY_new_by_curve_name(NID_secp384r1);
} else ec = NULL;
if(!ec) return NULL;
- if(keylen+1 > sizeof(buf))
- return NULL; /* sanity check */
+ if(keylen+1 > sizeof(buf)) { /* sanity check */
+ EC_KEY_free(ec);
+ return NULL;
+ }
/* prepend the 0x02 (from docs) (or actually 0x04 from implementation
* of openssl) for uncompressed data */
buf[0] = POINT_CONVERSION_UNCOMPRESSED;