[PATCH] delayacct: Fix missing free

From: zhangjiao2
Date: Wed Sep 04 2024 - 06:53:05 EST


From: zhang jiao <zhangjiao2@xxxxxxxxxxxxxxxxxxxx>

Free string allocated by strdup().

Signed-off-by: zhang jiao <zhangjiao2@xxxxxxxxxxxxxxxxxxxx>
---
tools/accounting/getdelays.c | 1 +
tools/accounting/procacct.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/tools/accounting/getdelays.c b/tools/accounting/getdelays.c
index 1334214546d7..b08d3e2c871c 100644
--- a/tools/accounting/getdelays.c
+++ b/tools/accounting/getdelays.c
@@ -562,6 +562,7 @@ int main(int argc, char *argv[])
err(rc, "error sending deregister cpumask\n");
}
err:
+ free(logfile);
close(nl_sd);
if (fd)
close(fd);
diff --git a/tools/accounting/procacct.c b/tools/accounting/procacct.c
index 90c4a37f53d9..28825fd68a12 100644
--- a/tools/accounting/procacct.c
+++ b/tools/accounting/procacct.c
@@ -403,6 +403,7 @@ int main(int argc, char *argv[])
err(rc, "error sending deregister cpumask\n");
}
err:
+ free(logfile);
close(nl_sd);
if (fd)
close(fd);
--
2.33.0