getnetid() crashes if no /etc/netid file is present (it tries to fclose()

a FILE * handle that wasn't really open).
This commit is contained in:
Bill Paul 1997-06-12 18:42:43 +00:00
parent 18d5819376
commit f7cf1c1d14

View file

@ -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