diff options
author | tb <> | 2024-04-09 16:06:01 +0000 |
---|---|---|
committer | tb <> | 2024-04-09 16:06:01 +0000 |
commit | e50ad813223e321277bde54e32100ac8130a7148 (patch) | |
tree | bb835357065797de87c8650289457da64240e17e /src | |
parent | bbf690f8fa85727944755535bb3512d598ade359 (diff) | |
download | openbsd-e50ad813223e321277bde54e32100ac8130a7148.tar.gz openbsd-e50ad813223e321277bde54e32100ac8130a7148.tar.bz2 openbsd-e50ad813223e321277bde54e32100ac8130a7148.zip |
bn_convert: plug leak spotted by ASAN
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_convert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_convert.c b/src/regress/lib/libcrypto/bn/bn_convert.c index df69b78050..c787036cc4 100644 --- a/src/regress/lib/libcrypto/bn/bn_convert.c +++ b/src/regress/lib/libcrypto/bn/bn_convert.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_convert.c,v 1.4 2024/04/09 14:56:21 jsing Exp $ */ | 1 | /* $OpenBSD: bn_convert.c,v 1.5 2024/04/09 16:06:01 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -482,7 +482,8 @@ test_bn_convert(void) | |||
482 | } | 482 | } |
483 | 483 | ||
484 | free(mpi_out); | 484 | free(mpi_out); |
485 | 485 | mpi_out = NULL; | |
486 | |||
486 | if ((mpi_len = BN_bn2mpi(bn, NULL)) != bct->mpi_len) { | 487 | if ((mpi_len = BN_bn2mpi(bn, NULL)) != bct->mpi_len) { |
487 | fprintf(stderr, "FAIL: Test %zu - BN_bn2mpi() returned " | 488 | fprintf(stderr, "FAIL: Test %zu - BN_bn2mpi() returned " |
488 | "%d, want %d", i, mpi_len, bct->mpi_len); | 489 | "%d, want %d", i, mpi_len, bct->mpi_len); |
@@ -550,6 +551,7 @@ test_bn_convert(void) | |||
550 | failed = 0; | 551 | failed = 0; |
551 | 552 | ||
552 | failure: | 553 | failure: |
554 | free(mpi_out); | ||
553 | free(out_str); | 555 | free(out_str); |
554 | BN_free(bn); | 556 | BN_free(bn); |
555 | 557 | ||