summaryrefslogtreecommitdiffstats
path: root/apps/pkeyutl.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-30 23:48:31 +0200
committerRich Salz <rsalz@openssl.org>2015-04-30 23:48:31 +0200
commit68dc682499ea3fe27d909c946d7abd39062d6efd (patch)
tree3478a6fb3699bdfa08d5871848696882ee1c24db /apps/pkeyutl.c
parentfree NULL cleanup 5a (diff)
downloadopenssl-68dc682499ea3fe27d909c946d7abd39062d6efd.tar.xz
openssl-68dc682499ea3fe27d909c946d7abd39062d6efd.zip
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/pkeyutl.c')
-rw-r--r--apps/pkeyutl.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index da7dc2e4cd..3afe0eb033 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -299,13 +299,10 @@ int pkeyutl_main(int argc, char **argv)
rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
buf_in, (size_t)buf_inlen);
if (rv > 0) {
- buf_out = OPENSSL_malloc(buf_outlen);
- if (!buf_out)
- rv = -1;
- else
- rv = do_keyop(ctx, pkey_op,
- buf_out, (size_t *)&buf_outlen,
- buf_in, (size_t)buf_inlen);
+ buf_out = app_malloc(buf_outlen, "buffer output");
+ rv = do_keyop(ctx, pkey_op,
+ buf_out, (size_t *)&buf_outlen,
+ buf_in, (size_t)buf_inlen);
}
if (rv <= 0) {
ERR_print_errors(bio_err);