diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 17:48:31 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 17:48:31 -0400 |
commit | 68dc682499ea3fe27d909c946d7abd39062d6efd (patch) | |
tree | 3478a6fb3699bdfa08d5871848696882ee1c24db /apps/pkeyutl.c | |
parent | 222561fe8ef510f336417a666f69f81ddc9b8fe4 (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/pkeyutl.c')
-rw-r--r-- | apps/pkeyutl.c | 11 |
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); |