diff mbox series

trace-cmd sqlhist: Fix missing initialization of a var

Message ID 20241104152335.0fcb2d7d@gandalf.local.home (mailing list archive)
State Accepted
Commit 201f95fdbe7c344a5875e5d78362bfdded74c2a9
Headers show
Series trace-cmd sqlhist: Fix missing initialization of a var | expand

Commit Message

Steven Rostedt Nov. 4, 2024, 8:23 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The variable "var" was used without being initialized and caused bugs when
it wasn't set via: -m or -c options.

Fixes: 1d5ac88ee ("trace-cmd sqlhist: Add 'sqlhist' command")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 tracecmd/trace-sqlhist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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