diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 23:48:31 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 23:48:31 +0200 |
commit | 68dc682499ea3fe27d909c946d7abd39062d6efd (patch) | |
tree | 3478a6fb3699bdfa08d5871848696882ee1c24db /apps/pkeyutl.c | |
parent | free NULL cleanup 5a (diff) | |
download | openssl-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.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); |