diff options
author | 2015-08-28 00:03:53 +0000 | |
---|---|---|
committer | 2015-08-28 00:03:53 +0000 | |
commit | bae2bd509caafb58e32eb30678e33df546f85cbd (patch) | |
tree | e2e5d64033fc6209583f14e91349f7b131de68f5 /sys/crypto/crypto.c | |
parent | Update: add include/libdrm, sort include/EGL, add share/util-macros (diff) | |
download | wireguard-openbsd-bae2bd509caafb58e32eb30678e33df546f85cbd.tar.xz wireguard-openbsd-bae2bd509caafb58e32eb30678e33df546f85cbd.zip |
fairly simple sizes for free(); ok tedu
Diffstat (limited to 'sys/crypto/crypto.c')
-rw-r--r-- | sys/crypto/crypto.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index 8ab5563e9a9..1222d21604a 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.74 2015/02/09 03:15:41 dlg Exp $ */ +/* $OpenBSD: crypto.c,v 1.75 2015/08/28 00:03:53 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -260,9 +260,11 @@ crypto_get_driverid(u_int8_t flags) newdrv[i].cc_sessions = 1; /* Mark */ newdrv[i].cc_flags = flags; - crypto_drivers_num *= 2; - free(crypto_drivers, M_CRYPTO_DATA, 0); + free(crypto_drivers, M_CRYPTO_DATA, + crypto_drivers_num * sizeof(struct cryptocap)); + + crypto_drivers_num *= 2; crypto_drivers = newdrv; splx(s); return i; |