diff options
author | miod <> | 2016-11-05 15:21:20 +0000 |
---|---|---|
committer | miod <> | 2016-11-05 15:21:20 +0000 |
commit | ba7c6bac5d2c870a4d1c1ce9f08db5e57c660625 (patch) | |
tree | 3ff1170fcf21ad73d4b0495b47f156e6cd3e93b1 | |
parent | 866700544190d5e3245e7a8248a04e1fe84d25a6 (diff) | |
download | openbsd-ba7c6bac5d2c870a4d1c1ce9f08db5e57c660625.tar.gz openbsd-ba7c6bac5d2c870a4d1c1ce9f08db5e57c660625.tar.bz2 openbsd-ba7c6bac5d2c870a4d1c1ce9f08db5e57c660625.zip |
Check BIO_new*() for failure.
ok beck@ jsing@
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_ht.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/x509v3/pcy_tree.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c index 4d21543396..61af3717b7 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ht.c +++ b/src/lib/libcrypto/ocsp/ocsp_ht.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocsp_ht.c,v 1.22 2014/10/03 06:02:38 doug Exp $ */ | 1 | /* $OpenBSD: ocsp_ht.c,v 1.23 2016/11/05 15:21:20 miod Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -157,7 +157,10 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline) | |||
157 | if (rctx == NULL) | 157 | if (rctx == NULL) |
158 | return NULL; | 158 | return NULL; |
159 | rctx->state = OHS_ERROR; | 159 | rctx->state = OHS_ERROR; |
160 | rctx->mem = BIO_new(BIO_s_mem()); | 160 | if ((rctx->mem = BIO_new(BIO_s_mem())) == NULL) { |
161 | free(rctx); | ||
162 | return NULL; | ||
163 | } | ||
161 | rctx->io = io; | 164 | rctx->io = io; |
162 | rctx->asn1_len = 0; | 165 | rctx->asn1_len = 0; |
163 | if (maxline > 0) | 166 | if (maxline > 0) |
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c index 7b28acbe1f..a56c183bc9 100644 --- a/src/lib/libcrypto/x509v3/pcy_tree.c +++ b/src/lib/libcrypto/x509v3/pcy_tree.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pcy_tree.c,v 1.16 2016/03/11 07:08:45 mmcc Exp $ */ | 1 | /* $OpenBSD: pcy_tree.c,v 1.17 2016/11/05 15:21:20 miod Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2004. | 3 | * project 2004. |
4 | */ | 4 | */ |
@@ -99,7 +99,9 @@ tree_print(char *str, X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) | |||
99 | int i; | 99 | int i; |
100 | BIO *err; | 100 | BIO *err; |
101 | 101 | ||
102 | err = BIO_new_fp(stderr, BIO_NOCLOSE); | 102 | if ((err = BIO_new_fp(stderr, BIO_NOCLOSE)) == NULL) |
103 | return; | ||
104 | |||
103 | if (!curr) | 105 | if (!curr) |
104 | curr = tree->levels + tree->nlevel; | 106 | curr = tree->levels + tree->nlevel; |
105 | else | 107 | else |