summaryrefslogtreecommitdiffstats
path: root/apps/dhparam.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-30 17:48:31 -0400
committerRich Salz <rsalz@openssl.org>2015-04-30 17:48:31 -0400
commit68dc682499ea3fe27d909c946d7abd39062d6efd (patch)
tree3478a6fb3699bdfa08d5871848696882ee1c24db /apps/dhparam.c
parent222561fe8ef510f336417a666f69f81ddc9b8fe4 (diff)
In apps, malloc or die
No point in proceeding if you're out of memory. So change *all* OPENSSL_malloc calls in apps to use the new routine which prints a message and exits. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/dhparam.c')
-rw-r--r--apps/dhparam.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c
index e7fa7ae26f..c66c5916cf 100644
--- a/apps/dhparam.c
+++ b/apps/dhparam.c
@@ -379,11 +379,7 @@ int dhparam_main(int argc, char **argv)
len = BN_num_bytes(dh->p);
bits = BN_num_bits(dh->p);
- data = OPENSSL_malloc(len);
- if (data == NULL) {
- perror("OPENSSL_malloc");
- goto end;
- }
+ data = app_malloc(len, "print a BN");
BIO_printf(out, "#ifndef HEADER_DH_H\n"
"# include <openssl/dh.h>\n"
"#endif\n"