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/rsautl.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/rsautl.c')
-rw-r--r-- | apps/rsautl.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/rsautl.c b/apps/rsautl.c index 67cb76e8ce..f138293a18 100644 --- a/apps/rsautl.c +++ b/apps/rsautl.c @@ -257,12 +257,8 @@ int rsautl_main(int argc, char **argv) keysize = RSA_size(rsa); - rsa_in = OPENSSL_malloc(keysize * 2); - rsa_out = OPENSSL_malloc(keysize); - if (!rsa_in || !rsa_out) { - BIO_printf(bio_err, "Out of memory\n"); - goto end; - } + rsa_in = app_malloc(keysize * 2, "hold rsa key"); + rsa_out = app_malloc(keysize, "output rsa key"); /* Read the input data */ rsa_inlen = BIO_read(in, rsa_in, keysize * 2); |