diff options
author | Frederic Cambus <fcambus@cvs.openbsd.org> | 2018-05-31 19:40:59 +0000 |
---|---|---|
committer | Frederic Cambus <fcambus@cvs.openbsd.org> | 2018-05-31 19:40:59 +0000 |
commit | 28dd2d6559606c8e3362c9aea5408fc4db644cf7 (patch) | |
tree | 8f3f1d50cad97225d8356e02c41389109ccd7405 | |
parent | 119b4cbbde107b8f33f467e12362a06414913977 (diff) |
Add sizes for free().
OK visa@
-rw-r--r-- | sys/crypto/cryptosoft.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c index 2372fe95682..8297a614b76 100644 --- a/sys/crypto/cryptosoft.c +++ b/sys/crypto/cryptosoft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptosoft.c,v 1.83 2017/05/02 11:44:32 mikeb Exp $ */ +/* $OpenBSD: cryptosoft.c,v 1.84 2018/05/31 19:40:58 fcambus Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -971,7 +971,8 @@ swcr_freesession(u_int64_t tid) if (swd->sw_kschedule) { explicit_bzero(swd->sw_kschedule, txf->ctxsize); - free(swd->sw_kschedule, M_CRYPTO_DATA, 0); + free(swd->sw_kschedule, M_CRYPTO_DATA, + txf->ctxsize); } break; @@ -985,11 +986,11 @@ swcr_freesession(u_int64_t tid) if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA, 0); + free(swd->sw_ictx, M_CRYPTO_DATA, axf->ctxsize); } if (swd->sw_octx) { explicit_bzero(swd->sw_octx, axf->ctxsize); - free(swd->sw_octx, M_CRYPTO_DATA, 0); + free(swd->sw_octx, M_CRYPTO_DATA, axf->ctxsize); } break; @@ -1001,12 +1002,12 @@ swcr_freesession(u_int64_t tid) if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA, 0); + free(swd->sw_ictx, M_CRYPTO_DATA, axf->ctxsize); } break; } - free(swd, M_CRYPTO_DATA, 0); + free(swd, M_CRYPTO_DATA, sizeof(*swd)); } return 0; } |