diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-06-05 07:11:32 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-06-05 07:11:32 +0000 |
commit | 170b20bd940ed14b50ca80a13f2f578b937fab5b (patch) | |
tree | f8fea7d89d2893a3ed52ee61b0d348834aabeb75 /init | |
parent | a96f0888d30f5eb1cac685d2bee61cca8767209c (diff) | |
download | busybox-w32-170b20bd940ed14b50ca80a13f2f578b937fab5b.tar.gz busybox-w32-170b20bd940ed14b50ca80a13f2f578b937fab5b.tar.bz2 busybox-w32-170b20bd940ed14b50ca80a13f2f578b937fab5b.zip |
plug fd leak noticed by Russ Dill
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@4858 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-rw-r--r-- | init/start_stop_daemon.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/init/start_stop_daemon.c b/init/start_stop_daemon.c index 29e3d8673..6b090437f 100644 --- a/init/start_stop_daemon.c +++ b/init/start_stop_daemon.c | |||
@@ -113,6 +113,7 @@ pid_is_exec(int pid, const char *exec) | |||
113 | sprintf(buf, "/proc/%d/cmdline", pid); | 113 | sprintf(buf, "/proc/%d/cmdline", pid); |
114 | fp = fopen(buf, "r"); | 114 | fp = fopen(buf, "r"); |
115 | if (fp && fgets (buf, sizeof (buf), fp) ) { | 115 | if (fp && fgets (buf, sizeof (buf), fp) ) { |
116 | fclose(fp); | ||
116 | if (strncmp (buf, exec, strlen(exec)) == 0) | 117 | if (strncmp (buf, exec, strlen(exec)) == 0) |
117 | return 1; | 118 | return 1; |
118 | } | 119 | } |