Make sure we close all open files.

This commit is contained in:
Martin Baulig
2000-02-14 14:34:33 +00:00
parent 20bbc17f6b
commit 75958ce2ab
3 changed files with 10 additions and 3 deletions

View File

@@ -290,7 +290,10 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
}
/* Should never happen. */
if (fields < 2) return;
if (fields < 2) {
fclose (f);
return;
}
fields--;
while (fgets (buffer, BUFSIZ-1, f)) {