summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-04-09 16:06:02 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-04-09 16:06:02 +0000
commit036565936f8623cd607dd6157f47881c851dfc9b (patch)
tree65f44fbe9a6691da548d8780c28a840843d08dcc /regress
parent5b5c51a8c883f7c442b5c3929a70c1b4c33b0483 (diff)
bn_convert: plug leak spotted by ASAN
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libcrypto/bn/bn_convert.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/regress/lib/libcrypto/bn/bn_convert.c b/regress/lib/libcrypto/bn/bn_convert.c
index df69b78050a..c787036cc4f 100644
--- a/regress/lib/libcrypto/bn/bn_convert.c
+++ b/regress/lib/libcrypto/bn/bn_convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_convert.c,v 1.4 2024/04/09 14:56:21 jsing Exp $ */
+/* $OpenBSD: bn_convert.c,v 1.5 2024/04/09 16:06:01 tb Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
@@ -482,7 +482,8 @@ test_bn_convert(void)
}
free(mpi_out);
-
+ mpi_out = NULL;
+
if ((mpi_len = BN_bn2mpi(bn, NULL)) != bct->mpi_len) {
fprintf(stderr, "FAIL: Test %zu - BN_bn2mpi() returned "
"%d, want %d", i, mpi_len, bct->mpi_len);
@@ -550,6 +551,7 @@ test_bn_convert(void)
failed = 0;
failure:
+ free(mpi_out);
free(out_str);
BN_free(bn);