From 4666ba4ab3019b2939fa31f97ee94d1be500794a Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 7 Oct 2015 14:49:04 +0000 Subject: [PATCH] easy free sizes; ok mpi --- sys/kern/sysv_msg.c | 6 +++--- sys/kern/sysv_shm.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index bfad640ad08..ae7002cd7f3 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_msg.c,v 1.30 2014/12/19 05:59:21 tedu Exp $ */ +/* $OpenBSD: sysv_msg.c,v 1.31 2015/10/07 14:49:04 deraadt Exp $ */ /* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */ /* * Copyright (c) 2009 Bret S. Lambert @@ -393,7 +393,7 @@ que_create(key_t key, struct ucred *cred, int mode) /* if malloc slept, a queue with the same key may have been created */ if (que_key_lookup(key)) { - free(que, M_TEMP, 0); + free(que, M_TEMP, sizeof *que); return (NULL); } @@ -488,7 +488,7 @@ que_free(struct que *que) TAILQ_REMOVE(&que->que_msgs, msg, msg_next); msg_free(msg); } - free(que, M_TEMP, 0); + free(que, M_TEMP, sizeof *que); num_ques--; } diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index b815ff457bc..c3e902ca173 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.66 2015/03/14 03:38:50 jsg Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.67 2015/10/07 14:49:04 deraadt Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -599,7 +599,7 @@ sysctl_sysvshm(int *name, u_int namelen, void *oldp, size_t *oldlenp, M_WAITOK|M_ZERO); memcpy(newseqs, shmseqs, shminfo.shmmni * sizeof(unsigned short)); - free(shmseqs, M_SHM, 0); + free(shmseqs, M_SHM, shminfo.shmmni * sizeof(unsigned short)); shmseqs = newseqs; shminfo.shmmni = val; return (0); -- 2.20.1