aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-06-05 07:11:32 +0000
committerEric Andersen <andersen@codepoet.org>2002-06-05 07:11:32 +0000
commitff7661d9de75d0d92d76fc276b285f4138edf8c8 (patch)
treef8fea7d89d2893a3ed52ee61b0d348834aabeb75
parent1fca558799350fb6caff97f55aa6d1237b08fccb (diff)
downloadbusybox-w32-ff7661d9de75d0d92d76fc276b285f4138edf8c8.tar.gz
busybox-w32-ff7661d9de75d0d92d76fc276b285f4138edf8c8.tar.bz2
busybox-w32-ff7661d9de75d0d92d76fc276b285f4138edf8c8.zip
plug fd leak noticed by Russ Dill
-Erik
-rw-r--r--debianutils/start_stop_daemon.c1
-rw-r--r--init/start_stop_daemon.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 29e3d8673..6b090437f 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/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 }
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 }