diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2002-08-23 00:56:05 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2002-08-23 00:56:05 +0000 |
commit | 7b3f8875a9bad5d14096d23a856098592ed51505 (patch) | |
tree | 6da6386c8d0a811f341d4673ae82f2a169167473 /sys/kern | |
parent | eedfbef3637dc47b65d1dc433fb7d469bbd86005 (diff) |
Add missing FRELE() in finishdup() error case; ok art
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index d54f2880dc7..3b3ee94feb4 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_descrip.c,v 1.58 2002/06/03 12:04:08 deraadt Exp $ */ +/* $OpenBSD: kern_descrip.c,v 1.59 2002/08/23 00:56:04 pvalchev Exp $ */ /* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */ /* @@ -285,6 +285,7 @@ restart: if (new != i) panic("dup2: fdalloc"); } + /* finishdup() does FRELE */ return (finishdup(p, fp, old, new, retval)); } @@ -511,8 +512,10 @@ finishdup(struct proc *p, struct file *fp, int old, int new, register_t *retval) if (oldfp != NULL) FREF(oldfp); - if (fp->f_count == LONG_MAX-2) + if (fp->f_count == LONG_MAX-2) { + FRELE(fp); return (EDEADLK); + } fdp->fd_ofiles[new] = fp; fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] & ~UF_EXCLOSE; fp->f_count++; |