summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1997-06-12 18:42:43 +0000
committerwpaul <wpaul@FreeBSD.org>1997-06-12 18:42:43 +0000
commit6f8dcc82713b676c6318a4a1af4e3df7ff198637 (patch)
treece70bdca80f363119fc16f8c9476338d7f935099 /lib/libc/rpc
parent49a4edd9b125cd144ccf256f2f161c0afedc56f1 (diff)
downloadFreeBSD-src-6f8dcc82713b676c6318a4a1af4e3df7ff198637.zip
FreeBSD-src-6f8dcc82713b676c6318a4a1af4e3df7ff198637.tar.gz
getnetid() crashes if no /etc/netid file is present (it tries to fclose()
a FILE * handle that wasn't really open).
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/netnamer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c
index 391cc20..41c5146 100644
--- a/lib/libc/rpc/netnamer.c
+++ b/lib/libc/rpc/netnamer.c
@@ -292,7 +292,8 @@ getnetid(key, ret)
lookup[len] = 0;
strcpy(ret, lookup);
free(lookup);
- fclose(fd);
+ if (fd != NULL)
+ fclose(fd);
return (2);
#else /* YP */
#ifdef DEBUG
OpenPOWER on IntegriCloud