summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-09-02 02:48:57 +0000
committerderaadt <deraadt@openbsd.org>1996-09-02 02:48:57 +0000
commit75703a170ef1ff9af0f3d870e09ba260c4b406ab (patch)
treed6e76d8d0fc60106ca5e088f3aa7b045735cb97d /lib/libc
parentloop till quit (diff)
downloadwireguard-openbsd-75703a170ef1ff9af0f3d870e09ba260c4b406ab.tar.xz
wireguard-openbsd-75703a170ef1ff9af0f3d870e09ba260c4b406ab.zip
do not leak byname; this needs a complete rewrite
Diffstat (limited to 'lib/libc')
-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