Skip to contentSkip to conversation

trace-cmd sqlhist: Fix missing initialization of a var

PATCH New Steven Rostedt 1 participant 1 message Nov 4, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd sqlhist: Fix missing initialization of a var

From: "Steven Rostedt (Google)" <[email protected]>

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")
---
 tracecmd/trace-sqlhist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tracecmd/trace-sqlhist.c +1 -1
index f53feb24..9e304e43 100644
@@ -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;
Signature · 1 line
2.43.0