Reject invalid constructed encodings.
[oweals/openssl.git] / crypto / asn1 / bio_asn1.c
index 854a52d3d5e591bfc7a49d8771290418928f75d1..bca4eebf6d3fb62ab8abdfa15398764f983e1321 100644 (file)
@@ -1,5 +1,5 @@
 /* bio_asn1.c */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project.
  */
 /* ====================================================================
@@ -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;