summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/bio_asn1.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-06-27 04:21:10 +0200
committerDr. Stephen Henson <steve@openssl.org>2014-06-27 15:35:07 +0200
commitd2aea038297e0c64ca66e6844cbb37377365885e (patch)
tree13e11f5b4a91e0dc5316bb7c6fb7203c313be84b /crypto/asn1/bio_asn1.c
parentMake sure BN_sqr can never return a negative value. (diff)
downloadopenssl-d2aea038297e0c64ca66e6844cbb37377365885e.tar.xz
openssl-d2aea038297e0c64ca66e6844cbb37377365885e.zip
Memory leak and NULL dereference fixes.
PR#3403
Diffstat (limited to 'crypto/asn1/bio_asn1.c')
-rw-r--r--crypto/asn1/bio_asn1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/asn1/bio_asn1.c b/crypto/asn1/bio_asn1.c
index dc7efd551c..bca4eebf6d 100644
--- a/crypto/asn1/bio_asn1.c
+++ b/crypto/asn1/bio_asn1.c
@@ -154,7 +154,10 @@ static int asn1_bio_new(BIO *b)
if (!ctx)
return 0;
if (!asn1_bio_init(ctx, DEFAULT_ASN1_BUF_SIZE))
+ {
+ OPENSSL_free(ctx);
return 0;
+ }
b->init = 1;
b->ptr = (char *)ctx;
b->flags = 0;