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:
wpaul 1997-06-12 18:42:43 +00:00
parent 95dc2e2267
commit a9c5ca51ee

View File

@ -292,7 +292,8 @@ getnetid(key, ret)
lookup[len] = 0; lookup[len] = 0;
strcpy(ret, lookup); strcpy(ret, lookup);
free(lookup); free(lookup);
fclose(fd); if (fd != NULL)
fclose(fd);
return (2); return (2);
#else /* YP */ #else /* YP */
#ifdef DEBUG #ifdef DEBUG