diff options
Diffstat (limited to 'crypto/asn1/a_digest.c')
-rw-r--r-- | crypto/asn1/a_digest.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/asn1/a_digest.c b/crypto/asn1/a_digest.c index 4931e222a0..7182e9fa5d 100644 --- a/crypto/asn1/a_digest.c +++ b/crypto/asn1/a_digest.c @@ -65,6 +65,7 @@ # include <sys/types.h> #endif +#include <openssl/err.h> #include <openssl/evp.h> #include <openssl/buffer.h> #include <openssl/x509.h> @@ -78,7 +79,11 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data, unsigned char *str,*p; i=i2d(data,NULL); - if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) return(0); + if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) + { + ASN1err(ASN1_F_ASN1_DIGEST,ERR_R_MALLOC_FAILURE); + return(0); + } p=str; i2d(data,&p); |