Stop leaking file handles.
authorMatt Kraai <kraai@debian.org>
Thu, 7 Sep 2000 04:34:17 +0000 (04:34 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 7 Sep 2000 04:34:17 +0000 (04:34 -0000)
procps/ps.c
ps.c

index b49b7ddd4e4973ef126db42f472699bb31924f63..ae33e3262b03d86a393664e05b312bf4ca1e74f9 100644 (file)
@@ -177,6 +177,7 @@ extern int ps_main(int argc, char **argv)
                                c = ' ';
                        putc(c, stdout);
                }
+               fclose(file);
                if (i == 0)
                        fprintf(stdout, "[%s]", p.cmd);
                fprintf(stdout, "\n");
diff --git a/ps.c b/ps.c
index b49b7ddd4e4973ef126db42f472699bb31924f63..ae33e3262b03d86a393664e05b312bf4ca1e74f9 100644 (file)
--- a/ps.c
+++ b/ps.c
@@ -177,6 +177,7 @@ extern int ps_main(int argc, char **argv)
                                c = ' ';
                        putc(c, stdout);
                }
+               fclose(file);
                if (i == 0)
                        fprintf(stdout, "[%s]", p.cmd);
                fprintf(stdout, "\n");