diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-31 18:13:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-31 18:13:28 +0000 |
commit | f7126f79d21f045e286e35885f8274c64cdb2bd1 (patch) | |
tree | 421912b5ea0cb6e22625f2eb62470fd252167d2e /sys/crypto | |
parent | 607a16f3895b5ad0e886f7302add5a8c63d36d71 (diff) |
two fairly simple sizes for free()
Diffstat (limited to 'sys/crypto')
-rw-r--r-- | sys/crypto/cryptosoft.c | 7 |
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; |