From: tb Date: Wed, 29 Dec 2021 23:04:12 +0000 (+0000) Subject: Plug memleaks X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4fa78445abedec4c26fd2b47e6e654b4aff7ffb5;p=openbsd Plug memleaks CID 345150 --- diff --git a/regress/lib/libssl/unit/ssl_versions.c b/regress/lib/libssl/unit/ssl_versions.c index 2ca72157ab9..62ecc78245c 100644 --- a/regress/lib/libssl/unit/ssl_versions.c +++ b/regress/lib/libssl/unit/ssl_versions.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_versions.c,v 1.15 2021/06/27 16:54:55 jsing Exp $ */ +/* $OpenBSD: ssl_versions.c,v 1.16 2021/12/29 23:04:12 tb Exp $ */ /* * Copyright (c) 2016, 2017 Joel Sing * @@ -502,11 +502,13 @@ test_ssl_max_shared_version(void) if ((ssl_ctx = SSL_CTX_new(svt->ssl_method())) == NULL) { fprintf(stderr, "SSL_CTX_new() returned NULL\n"); - return 1; + failed++; + goto err; } if ((ssl = SSL_new(ssl_ctx)) == NULL) { fprintf(stderr, "SSL_new() returned NULL\n"); - return 1; + failed++; + goto err; } SSL_clear_options(ssl, SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | @@ -535,8 +537,14 @@ test_ssl_max_shared_version(void) SSL_CTX_free(ssl_ctx); SSL_free(ssl); + ssl_ctx = NULL; + ssl = NULL; } + err: + SSL_CTX_free(ssl_ctx); + SSL_free(ssl); + return (failed); }