summaryrefslogtreecommitdiff
path: root/main/openssl/crypto/asn1/asn_pack.c
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-11-14 09:52:32 +0100
committerArne Schwabe <arne@rfc2549.org>2014-11-14 09:52:32 +0100
commitb28828796ad6d65ac463b41bba153f74e4531a6b (patch)
tree154b9f7436ae575e324f3374a5145e451bf649a8 /main/openssl/crypto/asn1/asn_pack.c
parente7a6c1a987ebee1ddb2f908ca028d613a5c52490 (diff)
Update OpenSSL version
Diffstat (limited to 'main/openssl/crypto/asn1/asn_pack.c')
-rw-r--r--main/openssl/crypto/asn1/asn_pack.c12
1 files changed, 10 insertions, 2 deletions
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