Make sure we close all open files.

This commit is contained in:
Martin Baulig
2000-02-14 14:25:34 +00:00
parent c92bf0f9a9
commit 00a32c887c
4 changed files with 11 additions and 4 deletions

View File

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