summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2020-04-22 17:26:55 +0000
committertobhe <tobhe@cvs.openbsd.org>2020-04-22 17:26:55 +0000
commit7e72335b18969ccd76170aead570b78c4acd98c8 (patch)
tree5927f476ad2105db0f7a7ad99ee8ef4488edf05f
parentb65362b52071b6bc6f4be8aa5f2918a86f51d192 (diff)
Fix leaks in signature validation.
ok markus@
-rw-r--r--sbin/iked/crypto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/iked/crypto.c b/sbin/iked/crypto.c
index 59429c5a378..d6f6ac51a1f 100644
--- a/sbin/iked/crypto.c
+++ b/sbin/iked/crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.c,v 1.25 2020/04/20 20:03:38 tobhe Exp $ */
+/* $OpenBSD: crypto.c,v 1.26 2020/04/22 17:26:54 tobhe Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -652,6 +652,10 @@ dsa_setkey(struct iked_dsa *dsa, void *key, size_t keylen, uint8_t type)
goto err;
}
+ if (cert != NULL)
+ X509_free(cert);
+ BIO_free(rawcert); /* temporary for parsing */
+
return (dsa->dsa_keydata);
sslerr: