diff options
author | wpaul <wpaul@FreeBSD.org> | 1997-06-12 18:42:43 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1997-06-12 18:42:43 +0000 |
commit | 6f8dcc82713b676c6318a4a1af4e3df7ff198637 (patch) | |
tree | ce70bdca80f363119fc16f8c9476338d7f935099 /lib | |
parent | 49a4edd9b125cd144ccf256f2f161c0afedc56f1 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | lib/libc/rpc/netnamer.c | 3 |
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 |