-/* $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 <jsing@openbsd.org>
*
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 |
SSL_CTX_free(ssl_ctx);
SSL_free(ssl);
+ ssl_ctx = NULL;
+ ssl = NULL;
}
+ err:
+ SSL_CTX_free(ssl_ctx);
+ SSL_free(ssl);
+
return (failed);
}