From 88e8299b9cc256ecec6c31f20129ebfdccb6528e Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 12 Jan 2017 16:01:47 +0000 Subject: If tls_get_new_cb_bio() fails, an error will already be set. --- src/lib/libtls/tls_bio_cb.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/libtls/tls_bio_cb.c b/src/lib/libtls/tls_bio_cb.c index 813d98d990..f53039fa00 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.15 2017/01/12 15:58:56 jsing Exp $ */ +/* $OpenBSD: tls_bio_cb.c,v 1.16 2017/01/12 16:01:47 jsing Exp $ */ /* * Copyright (c) 2016 Tobias Pape * @@ -180,7 +180,6 @@ tls_get_new_cb_bio(struct tls *ctx) tls_set_errorx(ctx, "no callbacks registered"); return (NULL); } - if ((bio = BIO_new(bio_s_cb())) == NULL) { tls_set_errorx(ctx, "failed to create callback i/o"); return (NULL); @@ -205,10 +204,8 @@ 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; - if ((bio = tls_get_new_cb_bio(ctx)) == NULL) { - tls_set_errorx(ctx, "failed to create callback i/o"); + if ((bio = tls_get_new_cb_bio(ctx)) == NULL) goto err; - } SSL_set_bio(ctx->ssl_conn, bio, bio); -- cgit v1.2.3-55-g6feb