plug fd leak noticed by Russ Dill
-Erik
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 29e3d86..6b09043 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -113,6 +113,7 @@
sprintf(buf, "/proc/%d/cmdline", pid);
fp = fopen(buf, "r");
if (fp && fgets (buf, sizeof (buf), fp) ) {
+ fclose(fp);
if (strncmp (buf, exec, strlen(exec)) == 0)
return 1;
}
diff --git a/init/start_stop_daemon.c b/init/start_stop_daemon.c
index 29e3d86..6b09043 100644
--- a/init/start_stop_daemon.c
+++ b/init/start_stop_daemon.c
@@ -113,6 +113,7 @@
sprintf(buf, "/proc/%d/cmdline", pid);
fp = fopen(buf, "r");
if (fp && fgets (buf, sizeof (buf), fp) ) {
+ fclose(fp);
if (strncmp (buf, exec, strlen(exec)) == 0)
return 1;
}