summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-08-31 18:13:27 +0000
committerderaadt <deraadt@openbsd.org>2015-08-31 18:13:27 +0000
commitce8cce3e46c3dc4d145ccfd280b954e8d5c7a45c (patch)
treeb51190fcc7bbea194da4c4e4708ab986671ff56a
parentThe code that guesstimates the number of local GOT entries assumes that there (diff)
downloadwireguard-openbsd-ce8cce3e46c3dc4d145ccfd280b954e8d5c7a45c.tar.xz
wireguard-openbsd-ce8cce3e46c3dc4d145ccfd280b954e8d5c7a45c.zip
two fairly simple sizes for free()
-rw-r--r--sys/crypto/cryptosoft.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c
index ccc2d4a3a1b..e286e5eb98c 100644
--- a/sys/crypto/cryptosoft.c
+++ b/sys/crypto/cryptosoft.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptosoft.c,v 1.73 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: cryptosoft.c,v 1.74 2015/08/31 18:13:27 deraadt Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -673,7 +673,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw,
else
result = cxf->decompress(data, crd->crd_len, &out);
- free(data, M_CRYPTO_DATA, 0);
+ free(data, M_CRYPTO_DATA, crd->crd_len);
if (result == 0)
return EINVAL;
@@ -764,7 +764,8 @@ swcr_newsession(u_int32_t *sid, struct cryptoini *cri)
if (swcr_sessions) {
bcopy(swcr_sessions, swd,
(swcr_sesnum / 2) * sizeof(struct swcr_data *));
- free(swcr_sessions, M_CRYPTO_DATA, 0);
+ free(swcr_sessions, M_CRYPTO_DATA,
+ (swcr_sesnum / 2) * sizeof(struct swcr_data *));
}
swcr_sessions = swd;