diff options
author | 2019-01-09 12:11:38 +0000 | |
---|---|---|
committer | 2019-01-09 12:11:38 +0000 | |
commit | 319dd5c3f6a33d939bbe52127a8bb6f14d12b2cf (patch) | |
tree | 9f14673095fea57df786049665b2b3f45abe5028 | |
parent | No need to call usbd_fill_deviceinfo() from a task, it doesn't generate I/O. (diff) | |
download | wireguard-openbsd-319dd5c3f6a33d939bbe52127a8bb6f14d12b2cf.tar.xz wireguard-openbsd-319dd5c3f6a33d939bbe52127a8bb6f14d12b2cf.zip |
free(9) sizes.
ok visa@
-rw-r--r-- | sys/crypto/cryptosoft.c | 6 | ||||
-rw-r--r-- | sys/crypto/xform_ipcomp.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c index 8297a614b76..2856a73ccde 100644 --- a/sys/crypto/cryptosoft.c +++ b/sys/crypto/cryptosoft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptosoft.c,v 1.84 2018/05/31 19:40:58 fcambus Exp $ */ +/* $OpenBSD: cryptosoft.c,v 1.85 2019/01/09 12:11:38 mpi Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -688,7 +688,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw, if (crd->crd_flags & CRD_F_COMP) { if (result > crd->crd_len) { /* Compression was useless, we lost time */ - free(out, M_CRYPTO_DATA, 0); + free(out, M_CRYPTO_DATA, result); return 0; } } @@ -719,7 +719,7 @@ swcr_compdec(struct cryptodesc *crd, struct swcr_data *sw, } } } - free(out, M_CRYPTO_DATA, 0); + free(out, M_CRYPTO_DATA, result); return 0; } diff --git a/sys/crypto/xform_ipcomp.c b/sys/crypto/xform_ipcomp.c index 17d322ae432..896dfc3e450 100644 --- a/sys/crypto/xform_ipcomp.c +++ b/sys/crypto/xform_ipcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xform_ipcomp.c,v 1.7 2015/03/16 20:26:24 miod Exp $ */ +/* $OpenBSD: xform_ipcomp.c,v 1.8 2019/01/09 12:11:38 mpi Exp $ */ /* * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org) @@ -141,13 +141,13 @@ deflate_global(u_int8_t *data, u_int32_t size, int decomp, u_int8_t **out) if (count > buf[j].size) { bcopy(buf[j].out, *out, buf[j].size); *out += buf[j].size; - free(buf[j].out, M_CRYPTO_DATA, 0); + free(buf[j].out, M_CRYPTO_DATA, buf[j].size); count -= buf[j].size; } else { /* it should be the last buffer */ bcopy(buf[j].out, *out, count); *out += count; - free(buf[j].out, M_CRYPTO_DATA, 0); + free(buf[j].out, M_CRYPTO_DATA, buf[j].size); count = 0; } } @@ -157,7 +157,7 @@ deflate_global(u_int8_t *data, u_int32_t size, int decomp, u_int8_t **out) bad: *out = NULL; for (j = 0; buf[j].flag != 0; j++) - free(buf[j].out, M_CRYPTO_DATA, 0); + free(buf[j].out, M_CRYPTO_DATA, buf[j].size); if (decomp) inflateEnd(&zbuf); else |