summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_digest.c')
-rw-r--r--src/lib/libcrypto/asn1/a_digest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_digest.c b/src/lib/libcrypto/asn1/a_digest.c
index 4931e222a0..7182e9fa5d 100644
--- a/src/lib/libcrypto/asn1/a_digest.c
+++ b/src/lib/libcrypto/asn1/a_digest.c
@@ -65,6 +65,7 @@
65# include <sys/types.h> 65# include <sys/types.h>
66#endif 66#endif
67 67
68#include <openssl/err.h>
68#include <openssl/evp.h> 69#include <openssl/evp.h>
69#include <openssl/buffer.h> 70#include <openssl/buffer.h>
70#include <openssl/x509.h> 71#include <openssl/x509.h>
@@ -78,7 +79,11 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
78 unsigned char *str,*p; 79 unsigned char *str,*p;
79 80
80 i=i2d(data,NULL); 81 i=i2d(data,NULL);
81 if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) return(0); 82 if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL)
83 {
84 ASN1err(ASN1_F_ASN1_DIGEST,ERR_R_MALLOC_FAILURE);
85 return(0);
86 }
82 p=str; 87 p=str;
83 i2d(data,&p); 88 i2d(data,&p);
84 89