Free hook in the error path. Fixes a RESOURCE_LEAK error (CWE-772) Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx> --- lib/trace-cmd/trace-hooks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/trace-cmd/trace-hooks.c b/lib/trace-cmd/trace-hooks.c index a58b5356..47f25fb3 100644 --- a/lib/trace-cmd/trace-hooks.c +++ b/lib/trace-cmd/trace-hooks.c @@ -151,6 +151,7 @@ struct hook_list *tracecmd_create_event_hook(const char *arg) invalid_tok: tracecmd_warning("Invalid hook format '%s'", arg); + free(hook); return NULL; } -- 2.44.0