summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-11-10 01:39:36 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-11-10 01:39:36 +0000
commit928e856c8e70396c82d96daa77cf1a452f87bc0b (patch)
tree062e02cbf1bb49ee462b513b4f1bddbb9879bcaf /regress
parent5b91ec6e061e44006192d970532f142e42acd53a (diff)
fix a leak pointed out by Ben L (bobsayshi () live ! co ! uk)
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libcrypto/bn/rand/bn_rand_interval.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/regress/lib/libcrypto/bn/rand/bn_rand_interval.c b/regress/lib/libcrypto/bn/rand/bn_rand_interval.c
index 09b1a34eea5..b8b84bd8cc9 100644
--- a/regress/lib/libcrypto/bn/rand/bn_rand_interval.c
+++ b/regress/lib/libcrypto/bn/rand/bn_rand_interval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_rand_interval.c,v 1.2 2018/11/06 13:17:42 tb Exp $ */
+/* $OpenBSD: bn_rand_interval.c,v 1.3 2018/11/10 01:39:35 tb Exp $ */
/*
* Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
*
@@ -54,11 +54,11 @@ main(int argc, char *argv[])
int i, success = 1;
if ((a = BN_new()) == NULL)
- err(1, "BN_hex2bn");
+ err(1, "BN_new(a)");
if ((b = BN_new()) == NULL)
- err(1, "BN_hex2bn");
+ err(1, "BN_new(b)");
if ((x = BN_new()) == NULL)
- err(1, "BN_new()");
+ err(1, "BN_new(c)");
for (i = 0; i < NUM_TESTS; i++) {
if (!BN_rand(a, 256, 0, 0))
@@ -109,5 +109,9 @@ main(int argc, char *argv[])
else
printf("FAIL");
+ BN_free(a);
+ BN_free(b);
+ BN_free(x);
+
return 1 - success;
}