diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2004-12-05 01:03:15 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2004-12-05 01:03:15 +0000 |
commit | a0e7c8eede26b29b09057f48b8e51f46f8811ddd (patch) | |
tree | 2b50575b4e9e608b61cb74246915625bd99b85d8 /crypto/x509v3/v3_ia5.c | |
parent | a8e00b17ce840c58787e45411fa2ac4d6b1fb10c (diff) |
Add lots of checks for memory allocation failure, error codes to indicate
failure and freeing up memory if a failure occurs.
PR:620
Diffstat (limited to 'crypto/x509v3/v3_ia5.c')
-rw-r--r-- | crypto/x509v3/v3_ia5.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/x509v3/v3_ia5.c b/crypto/x509v3/v3_ia5.c index f9414456de..9683afa47c 100644 --- a/crypto/x509v3/v3_ia5.c +++ b/crypto/x509v3/v3_ia5.c @@ -82,7 +82,10 @@ static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, { char *tmp; if(!ia5 || !ia5->length) return NULL; - if (!(tmp = OPENSSL_malloc(ia5->length + 1))) return NULL; + if(!(tmp = OPENSSL_malloc(ia5->length + 1))) { + X509V3err(X509V3_F_I2S_ASN1_IA5STRING,ERR_R_MALLOC_FAILURE); + return NULL; + } memcpy(tmp, ia5->data, ia5->length); tmp[ia5->length] = 0; return tmp; |