Free buf at the end of the function. Fixes a RESOURCE_LEAK error (CWE-772) Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx> --- tracecmd/trace-record.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index a9e5e64d..2223d5bb 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -2509,6 +2509,7 @@ static void clear_func_filter(const char *file) filter[len+1] = '\0'; write_file(file, filter); } + free(buf); } static void update_reset_triggers(void) -- 2.44.0