diff options
| author | 2010-06-14 16:51:55 +0000 | |
|---|---|---|
| committer | 2010-06-14 16:51:55 +0000 | |
| commit | 78308f0b21578c8c2a64a55c34aa6c51711a4beb (patch) | |
| tree | 5bea0b6f63b1f106670dcf2b87c445ff90103417 /sys/dev/diskmap.c | |
| parent | fix block length for AES (diff) | |
| download | wireguard-openbsd-78308f0b21578c8c2a64a55c34aa6c51711a4beb.tar.xz wireguard-openbsd-78308f0b21578c8c2a64a55c34aa6c51711a4beb.zip | |
plug a memleak, free the devname when we succeed with
the ioctl. also remove an uneeded if (devname) check.
ok jsing@
Diffstat (limited to 'sys/dev/diskmap.c')
| -rw-r--r-- | sys/dev/diskmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c index cf5951a6e1d..f0abc974b9e 100644 --- a/sys/dev/diskmap.c +++ b/sys/dev/diskmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskmap.c,v 1.1 2010/06/08 12:46:49 jsing Exp $ */ +/* $OpenBSD: diskmap.c,v 1.2 2010/06/14 16:51:55 thib Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> @@ -122,6 +122,7 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) VOP_UNLOCK(vp, 0, p); + free(devname, M_DEVBUF); fdpunlock(fdp); return 0; @@ -133,8 +134,7 @@ bad: fdpunlock(fdp); invalid: - if (devname) - free(devname, M_DEVBUF); + free(devname, M_DEVBUF); return (error); } |
