libtracefs: Initialized func_list in tracefs_filter_functions()
PATCH 1/1 libtracefs: Initialized func_list in tracefs_filter_functions()
From: "Steven Rostedt (Google)" <[email protected]>
The variable func_list is used to create a link list and it is expected to be NULL. This causes a crash because of the logic checks it before it gets initialized.
Initialize func_list to NULL.
This was found by valgrind after a crash.
Fixes c1606fb72264a ("libtracefs: Implement tracefs_filter_functions()")
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/tracefs-tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/tracefs-tools.c +1 -1
@@ -1237,7 +1237,7 @@ void tracefs_trace_pipe_stop(struct tracefs_instance *instance)int tracefs_filter_functions (const char *filter,const char *module,char ***list) {struct func_filter func_filter; -struct func_list *func_list, *f; +struct func_list *func_list =NULL , *f;char **funcs =NULL ;int ret;
Signature · 1 line
2.33.0