From a095fd48b5773625cbe19b8a6c4d85902eafec6d Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 4 Nov 2016 15:45:55 +0000 Subject: Assign and test, as is consistent with the rest of the libtls code. --- src/lib/libtls/tls_bio_cb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libtls/tls_bio_cb.c b/src/lib/libtls/tls_bio_cb.c index 478bc1e614..28eba24c91 100644 --- a/src/lib/libtls/tls_bio_cb.c +++ b/src/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 * @@ -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; } -- cgit v1.2.3-55-g6feb