trace-cmd sqlhist: Initialize err value to tracefs_sql()
PATCH 1/1 trace-cmd sqlhist: Initialize err value to tracefs_sql()
From: "Steven Rostedt (Google)" <[email protected]>
If tracefs_sql() fails, it doesn't always initialize the passed in "err" pointer. That should be set to NULL before passing it in otherwise it can't be known if the function set it on error.
Fixes 1d5ac88ee ("trace-cmd sqlhist: Add 'sqlhist' command")
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- tracecmd/trace-sqlhist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tracecmd/trace-sqlhist.c +1 -1
@@ -28,7 +28,7 @@ static int do_sql(const char *instance_name,struct tep_handle *tep;struct trace_seq seq;enum tracefs_synth_handler handler; -char *err; +char *err =NULL ;int ret;if ((action &ACTIONS ) && !var)
Signature · 1 line
2.47.2