summaryrefslogtreecommitdiff
path: root/regress/sbin/isakmpd
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-09-04 17:47:38 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-09-04 17:47:38 +0000
commit0399c89402a806ff7a9b258acfe9ea5015115618 (patch)
treea9f263dfad0a3216f4351e14182378654d3a6fcd /regress/sbin/isakmpd
parent2fd9173279070c46e16ed3faee859d58e6101df9 (diff)
Fix use after free
Diffstat (limited to 'regress/sbin/isakmpd')
-rw-r--r--regress/sbin/isakmpd/prf/prftest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/regress/sbin/isakmpd/prf/prftest.c b/regress/sbin/isakmpd/prf/prftest.c
index ca3fa0635b3..a1b0c44be3a 100644
--- a/regress/sbin/isakmpd/prf/prftest.c
+++ b/regress/sbin/isakmpd/prf/prftest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prftest.c,v 1.1 2005/04/08 17:12:50 cloder Exp $ */
+/* $OpenBSD: prftest.c,v 1.2 2016/09/04 17:47:37 mikeb Exp $ */
/* $EOM: prftest.c,v 1.2 1998/10/07 16:40:50 niklas Exp $ */
/*
@@ -96,8 +96,6 @@ test_prf (char *test, enum hashes hash, char *key, int klen,
prf->Update (prf->prfctx, data, dlen);
prf->Final (digest, prf->prfctx);
- prf_free (prf);
-
for (i = 0; i < prf->blocksize; i++)
{
output[2 * i] = nibble2c ((digest[i] >> 4) & 0xf);
@@ -105,6 +103,8 @@ test_prf (char *test, enum hashes hash, char *key, int klen,
}
output[2 * i] = 0;
+ prf_free (prf);
+
if (strcmp (output, cmp) == 0)
{
printf ("OKAY\n");