Static analysis warned about a possible use-after-free error in tracecmd_parse_cmdlines() sscanf() fails to match both items. However, the function seems to not be used at all si we might as well remove it entirely. Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx> --- lib/trace-cmd/trace-util.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c index a4334a98..37caab45 100644 --- a/lib/trace-cmd/trace-util.c +++ b/lib/trace-cmd/trace-util.c @@ -135,23 +135,6 @@ bool tracecmd_get_notimeout(void) return notimeout || debug; } -void tracecmd_parse_cmdlines(struct tep_handle *pevent, - char *file, int size __maybe_unused) -{ - char *comm; - char *line; - char *next = NULL; - int pid; - - line = strtok_r(file, "\n", &next); - while (line) { - sscanf(line, "%d %m[^\n]s", &pid, &comm); - tep_register_comm(pevent, comm, pid); - free(comm); - line = strtok_r(NULL, "\n", &next); - } -} - void tracecmd_parse_proc_kallsyms(struct tep_handle *pevent, char *file, unsigned int size __maybe_unused) { -- 2.44.0