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:09:57 +0000 |
commit | 918bb8652969fd53f0c390c1cd909265ed502c7e (patch) | |
tree | 883afa725e4529a992611b5b02e8b5c784463e99 /apps/x509.c | |
parent | 618be04e407a7800a7198ac87fa5e8cee7c6e10b (diff) | |
download | openssl-918bb8652969fd53f0c390c1cd909265ed502c7e.tar.gz |
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>
Diffstat (limited to 'apps/x509.c')
-rw-r--r-- | apps/x509.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/x509.c b/apps/x509.c index 4b08c181ee..380f0f0be7 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -819,6 +819,11 @@ int MAIN(int argc, char **argv) z = i2d_X509(x, NULL); m = OPENSSL_malloc(z); + if (!m) { + BIO_printf(bio_err, "Out of memory\n"); + ERR_print_errors(bio_err); + goto end; + } d = (unsigned char *)m; z = i2d_X509_NAME(X509_get_subject_name(x), &d); |