summaryrefslogtreecommitdiff
path: root/lib/libtls
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2016-11-04 15:45:56 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2016-11-04 15:45:56 +0000
commitfb70c855784ae7b3f2bc9f1a721624dce550dc9e (patch)
treeec12e9886e3a543818242c43b4aa69d22b8d82b4 /lib/libtls
parentb5838f8d070022d2b4b0f54463c858026d347e8e (diff)
Assign and test, as is consistent with the rest of the libtls code.
Diffstat (limited to 'lib/libtls')
-rw-r--r--lib/libtls/tls_bio_cb.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libtls/tls_bio_cb.c b/lib/libtls/tls_bio_cb.c
index 478bc1e6144..28eba24c914 100644
--- a/lib/libtls/tls_bio_cb.c
+++ b/lib/libtls/tls_bio_cb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_bio_cb.c,v 1.13 2016/11/04 15:43:46 jsing Exp $ */
+/* $OpenBSD: tls_bio_cb.c,v 1.14 2016/11/04 15:45:55 jsing Exp $ */
/*
* Copyright (c) 2016 Tobias Pape <tobias@netshed.de>
*
@@ -59,8 +59,7 @@ bio_cb_new(BIO *bio)
{
struct bio_cb *bcb;
- bcb = calloc(1, sizeof(struct bio_cb));
- if (bcb == NULL)
+ if ((bcb = calloc(1, sizeof(struct bio_cb))) == NULL)
return (0);
bio->shutdown = 1;
@@ -180,8 +179,7 @@ tls_get_new_cb_bio(struct tls *ctx)
if (ctx->read_cb == NULL || ctx->write_cb == NULL)
tls_set_errorx(ctx, "no callbacks registered");
- bio = BIO_new(bio_s_cb());
- if (bio == NULL) {
+ if ((bio = BIO_new(bio_s_cb())) == NULL) {
tls_set_errorx(ctx, "failed to create callback i/o");
return (NULL);
}
@@ -205,8 +203,7 @@ tls_set_cbs(struct tls *ctx, tls_read_cb read_cb, tls_write_cb write_cb,
ctx->write_cb = write_cb;
ctx->cb_arg = cb_arg;
- bio = tls_get_new_cb_bio(ctx);
- if (bio == NULL) {
+ if ((bio = tls_get_new_cb_bio(ctx)) == NULL) {
tls_set_errorx(ctx, "failed to create callback i/o");
goto err;
}