diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2004-04-16 17:55:14 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2004-04-16 17:55:14 +0000 |
commit | bd5270c32fe3dd16cc0ef16ee27454fa9906a146 (patch) | |
tree | a2a37e238ca55a7d8d1cfb6c219ef2c80fa1580f /sys/kern/sysv_shm.c | |
parent | 3f6835d1c75a241142b8811825e77fbbb13cbc9a (diff) |
not a pasto. ok millert@
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r-- | sys/kern/sysv_shm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 99be9fccf55..046c3bc2481 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.41 2004/02/05 21:13:58 millert Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.42 2004/04/16 17:55:13 tedu Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -615,12 +615,14 @@ sysctl_sysvshm(int *name, u_int namelen, void *oldp, size_t *oldlenp, shminfo.shmmni * sizeof(struct shmid_ds *)); bzero(newsegs + shminfo.shmmni, (val - shminfo.shmmni) * sizeof(struct shmid_ds *)); + free(shmsegs, M_SHM); + shmsegs = newsegs; newseqs = malloc(val * sizeof(unsigned short), M_SHM, M_WAITOK); bcopy(shmseqs, newseqs, shminfo.shmmni * sizeof(unsigned short)); bzero(newseqs + shminfo.shmmni, (val - shminfo.shmmni) * sizeof(unsigned short)); - free(shmsegs, M_SHM); + free(shmseqs, M_SHM); shmseqs = newseqs; shminfo.shmmni = val; return (0); |