From: jsing Date: Thu, 22 Jun 2017 17:34:25 +0000 (+0000) Subject: Use the standard `rv' idiom in tls_keypair_load_cert(), rather than X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ae6dba76668bd8245e9073ca37f7742b08f93f0c;p=openbsd Use the standard `rv' idiom in tls_keypair_load_cert(), rather than duplicating clean up code. --- diff --git a/lib/libtls/tls_server.c b/lib/libtls/tls_server.c index abac01ca5cf..ea8f0ce7286 100644 --- a/lib/libtls/tls_server.c +++ b/lib/libtls/tls_server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_server.c,v 1.37 2017/05/06 20:59:28 jsing Exp $ */ +/* $OpenBSD: tls_server.c,v 1.38 2017/06/22 17:34:25 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -201,6 +201,7 @@ tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error, char *errstr = "unknown"; BIO *cert_bio = NULL; int ssl_err; + int rv = -1; X509_free(*cert); *cert = NULL; @@ -221,14 +222,12 @@ tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error, goto err; } - BIO_free(cert_bio); - - return (0); + rv = 0; err: BIO_free(cert_bio); - return (-1); + return (rv); } static int