From b28828796ad6d65ac463b41bba153f74e4531a6b Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 14 Nov 2014 09:52:32 +0100 Subject: Update OpenSSL version --- main/openssl/crypto/asn1/asn_pack.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'main/openssl/crypto/asn1/asn_pack.c') diff --git a/main/openssl/crypto/asn1/asn_pack.c b/main/openssl/crypto/asn1/asn_pack.c index ad738217..00dbf5ad 100644 --- a/main/openssl/crypto/asn1/asn_pack.c +++ b/main/openssl/crypto/asn1/asn_pack.c @@ -134,15 +134,23 @@ ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, ASN1_STRING **oct) if (!(octmp->length = i2d(obj, NULL))) { ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); - return NULL; + goto err; } if (!(p = OPENSSL_malloc (octmp->length))) { ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } octmp->data = p; i2d (obj, &p); return octmp; + err: + if (!oct || !*oct) + { + ASN1_STRING_free(octmp); + if (oct) + *oct = NULL; + } + return NULL; } #endif -- cgit v1.2.3