[PATCH 5/7] trace-cmd sqlhist: Initialize name in trace_sqlhist()

"Jerome Marchand" <[email protected]> Thu, 5 Dec 2024 15:44:37 +0100
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
The variable name in trace_sqlhist() can be used uninitialized in
do_sql() if it's not set with -n option. Initialize it to NULL like
the other strings.

Signed-off-by: Jerome Marchand <[email protected]>
---
 tracecmd/trace-sqlhist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tracecmd/trace-sqlhist.c b/tracecmd/trace-sqlhist.c
index 9e304e43..9f2b94e6 100644
--- a/tracecmd/trace-sqlhist.c
+++ b/tracecmd/trace-sqlhist.c
@@ -136,7 +136,7 @@ void trace_sqlhist (int argc, char **argv)
 	const char *instance = NULL;
 	bool execute = false;
 	char **save_fields = NULL;
-	const char *name;
+	const char *name = NULL;
 	const char *var = NULL;
 	char **save_argv;
 	int action = 0;
-- 
2.47.0