diff options
author | Matt Caswell <matt@openssl.org> | 2015-03-04 17:49:51 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-05 09:15:08 +0000 |
commit | d6b4a41d100c2d3b401baf8edc34085ff610c5ba (patch) | |
tree | 8218609640b11832193a700d07a139f4246d8ecd /apps/rsautl.c | |
parent | 9fdbaf3a322689a58381c724e4f3497320a69581 (diff) |
Unchecked malloc fixes
Miscellaneous unchecked malloc fixes. Also fixed some mem leaks on error
paths as I spotted them along the way.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 918bb8652969fd53f0c390c1cd909265ed502c7e)
Conflicts:
crypto/bio/bss_dgram.c
Diffstat (limited to 'apps/rsautl.c')
-rw-r--r-- | apps/rsautl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/rsautl.c b/apps/rsautl.c index 0030aca126..d642f9ad97 100644 --- a/apps/rsautl.c +++ b/apps/rsautl.c @@ -268,6 +268,11 @@ int MAIN(int argc, char **argv) rsa_in = OPENSSL_malloc(keysize * 2); rsa_out = OPENSSL_malloc(keysize); + if (!rsa_in || !rsa_out) { + BIO_printf(bio_err, "Out of memory\n"); + ERR_print_errors(bio_err); + goto end; + } /* Read the input data */ rsa_inlen = BIO_read(in, rsa_in, keysize * 2); |