summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/evp_asn1.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-06-27 03:21:10 +0100
committerDr. Stephen Henson <steve@openssl.org>2014-06-27 14:35:07 +0100
commitd2aea038297e0c64ca66e6844cbb37377365885e (patch)
tree13e11f5b4a91e0dc5316bb7c6fb7203c313be84b /crypto/asn1/evp_asn1.c
parent3b3b69ab25fbaba80a843dedec5ae9733fefca43 (diff)
Memory leak and NULL dereference fixes.
PR#3403
Diffstat (limited to 'crypto/asn1/evp_asn1.c')
-rw-r--r--crypto/asn1/evp_asn1.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c
index f3d9804860..1b9445973e 100644
--- a/crypto/asn1/evp_asn1.c
+++ b/crypto/asn1/evp_asn1.c
@@ -66,7 +66,11 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
ASN1_STRING *os;
if ((os=M_ASN1_OCTET_STRING_new()) == NULL) return(0);
- if (!M_ASN1_OCTET_STRING_set(os,data,len)) return(0);
+ if (!M_ASN1_OCTET_STRING_set(os,data,len))
+ {
+ M_ASN1_OCTET_STRING_free(os);
+ return 0;
+ }
ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,os);
return(1);
}