summaryrefslogtreecommitdiff
path: root/apps/x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/x509.c b/apps/x509.c
index 7c3b0807e1..929359b0da 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -783,6 +783,11 @@ int MAIN(int argc, char **argv)
z = i2d_X509(x, NULL);
m = OPENSSL_malloc(z);
+ if (!m) {
+ BIO_printf(bio_err, "Out of memory\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
d = (unsigned char *)m;
z = i2d_X509_NAME(X509_get_subject_name(x), &d);