summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-02 02:48:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-02 02:48:58 +0000
commit53bd0292678195cfdf8e4d2ec1ccf87eb38cb57f (patch)
tree65d34df092947dcb7920056ff8b9d7d56918cdcd /lib
parente43baee4b3299188013cbf66e6fa37afb5ce7b93 (diff)
do not leak byname; this needs a complete rewrite
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/getrpcent.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index ab555062553..185dd757a3a 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -29,7 +29,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getrpcent.c,v 1.4 1996/08/27 03:33:57 deraadt Exp $";
+static char *rcsid = "$OpenBSD: getrpcent.c,v 1.5 1996/09/02 02:48:57 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -100,14 +100,15 @@ getrpcbyname(name)
setrpcent(0);
while (rpc = getrpcent()) {
if (strcmp(rpc->r_name, name) == 0)
- return (rpc);
+ goto done;
for (rp = rpc->r_aliases; *rp != NULL; rp++) {
if (strcmp(*rp, name) == 0)
- return (rpc);
+ goto done;
}
}
+done:
endrpcent();
- return (NULL);
+ return (rpc);
}
void