diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2010-06-14 16:51:56 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2010-06-14 16:51:56 +0000 |
commit | 6404f437492509dfc5f56c068e074d75040d9e8d (patch) | |
tree | c907160d337597dd42886fead246dfc83f38dbb6 /sys/dev/diskmap.c | |
parent | e53e628b0a6ea4b193057d250ea0cb2dc6524c6e (diff) |
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); } |