diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-04-28 15:18:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-04-28 15:18:58 +0000 |
commit | 2412efabaebeb6717fe8b02a364d700af20657da (patch) | |
tree | 2d29df9fe2b7f6313de164b05c3ec7b3334bc6d3 /libexec/rpc.rusersd | |
parent | 62d4936e20cd213a9c840dab5b2d2786a66da765 (diff) |
fd leaks
Diffstat (limited to 'libexec/rpc.rusersd')
-rw-r--r-- | libexec/rpc.rusersd/rusers_proc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c index cae0f335f83..66ab365ff38 100644 --- a/libexec/rpc.rusersd/rusers_proc.c +++ b/libexec/rpc.rusersd/rusers_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rusers_proc.c,v 1.19 2003/07/10 00:04:28 david Exp $ */ +/* $OpenBSD: rusers_proc.c,v 1.20 2004/04/28 15:18:57 deraadt Exp $ */ /*- * Copyright (c) 1993 John Brezak @@ -29,7 +29,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.19 2003/07/10 00:04:28 david Exp $"; +static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.20 2004/04/28 15:18:57 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -132,6 +132,7 @@ rusers_num_svc(void *arg, struct svc_req *rqstp) lseek(fd, 0, SEEK_SET); ufp = fdopen(fd, "r"); if (!ufp) { + close(fd); syslog(LOG_ERR, "%m"); return (0); } @@ -164,6 +165,7 @@ do_names_3(int all) lseek(fd, 0, SEEK_SET); ufp = fdopen(fd, "r"); if (!ufp) { + close(fd); syslog(LOG_ERR, "%m"); return (NULL); } @@ -227,6 +229,7 @@ do_names_2(int all) lseek(fd, 0, SEEK_SET); ufp = fdopen(fd, "r"); if (!ufp) { + close(fd); syslog(LOG_ERR, "%m"); return (NULL); } @@ -290,6 +293,7 @@ do_names_1(int all) lseek(fd, 0, SEEK_SET); ufp = fdopen(fd, "r"); if (!ufp) { + close(fd); syslog(LOG_ERR, "%m"); return (NULL); } |