diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2018-03-28 23:15:38 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-04-14 09:31:49 +1000 |
commit | 89947af2c5e32ddceaeecc5f486577ad5b5f946c (patch) | |
tree | a577625c9876d3668e67c5be32d69188472a1586 /crypto/asn1/a_time.c | |
parent | f691578bdc9f2ef207666c278dd6c44b9825bd81 (diff) |
crypto: raise error on malloc failure
clean a few style nits.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14806)
Diffstat (limited to 'crypto/asn1/a_time.c')
-rw-r--r-- | crypto/asn1/a_time.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index 1a0c91ef9f..fb3bd2aca6 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -420,8 +420,10 @@ int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str) * new t.data would be freed after ASN1_STRING_copy is done. */ t.data = OPENSSL_zalloc(t.length + 1); - if (t.data == NULL) + if (t.data == NULL) { + ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE); goto out; + } memcpy(t.data, str + 2, t.length); t.type = V_ASN1_UTCTIME; } |