summaryrefslogtreecommitdiff
path: root/sys/net/bsd-comp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-07 18:29:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-07 18:29:36 +0000
commitfa923e0708220d89105b47a45327376940f45364 (patch)
tree86e2aecb617b4b2795e579264f23cc67a665b115 /sys/net/bsd-comp.c
parent6d8c113941bd33996dfdeda900d42903149a0bbf (diff)
one simple free, ok mpi
another not so simple free, repaired by mpi
Diffstat (limited to 'sys/net/bsd-comp.c')
-rw-r--r--sys/net/bsd-comp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/bsd-comp.c b/sys/net/bsd-comp.c
index 10b5780764b..39eb1f44ae8 100644
--- a/sys/net/bsd-comp.c
+++ b/sys/net/bsd-comp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bsd-comp.c,v 1.11 2015/07/15 22:16:41 deraadt Exp $ */
+/* $OpenBSD: bsd-comp.c,v 1.12 2015/10/07 18:29:35 deraadt Exp $ */
/* $NetBSD: bsd-comp.c,v 1.6 1996/10/13 02:10:58 christos Exp $ */
/* Because this code is derived from the 4.3BSD compress source:
@@ -357,7 +357,7 @@ bsd_alloc(options, opt_len, decomp)
db->lens = mallocarray(maxmaxcode + 1, sizeof(db->lens[0]), M_DEVBUF,
M_NOWAIT);
if (!db->lens) {
- free(db, M_DEVBUF, 0);
+ free(db, M_DEVBUF, newlen);
return NULL;
}
}
@@ -378,8 +378,8 @@ bsd_free(state)
struct bsd_db *db = (struct bsd_db *) state;
if (db->lens)
- free(db->lens, M_DEVBUF, 0);
- free(db, M_DEVBUF, 0);
+ free(db->lens, M_DEVBUF, (db->maxmaxcode + 1) * sizeof(db->lens[0]));
+ free(db, M_DEVBUF, db->totlen);
}
static void *