diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-28 00:03:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-28 00:03:55 +0000 |
commit | 5ad0e8c0aeab06cc8ce3a15ee37adfe7cc17c615 (patch) | |
tree | 4c6488a821b9d519bda84a6732552a136bbdbd76 /sys/crypto | |
parent | 345b5260c0d266903c3e0fe179df2a1d3c10a5dc (diff) |
fairly simple sizes for free(); ok tedu
Diffstat (limited to 'sys/crypto')
-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; |