Commit e0fa7ab4 authored by Riccardo Mancini's avatar Riccardo Mancini Committed by Arnaldo Carvalho de Melo
Browse files

perf probe-file: Delete namelist in del_events() on the error path

ASan reports some memory leaks when running:

  # perf test "42: BPF filter"

This second leak is caused by a strlist not being dellocated on error
inside probe_file__del_events.

This patch adds a goto label before the deallocation and makes the error
path jump to it.
Signed-off-by: default avatarRiccardo Mancini <>
Fixes: e7895e42 ("perf probe: Split del_perf_probe_events()")
Cc: Ian Rogers <>
Cc: Jiri Olsa <>
Cc: Mark Rutland <>
Cc: Namhyung Kim <>
Cc: Peter Zijlstra <>

Signed-off-by: default avatarArnaldo Carvalho de Melo <>
parent 937654ce
......@@ -377,11 +377,11 @@ int probe_file__del_events(int fd, struct strfilter *filter)
ret = probe_file__get_events(fd, filter, namelist);
if (ret < 0)
return ret;
goto out;
ret = probe_file__del_strlist(fd, namelist);
return ret;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment