[PATCH 15/15] libtracefs: initialize val in build_filter()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In build_filter(), val is only initialized if filter->rval->type is
either EXPR_NUMBER or EXPR_STRING. AS far as I can understand that is
expected at that point. Howvever, it doesn't cost much to initialize
it in case the parser let some bogus request pass by and it should
prevent the static analyser to complain.

Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx>
---
 src/tracefs-sqlhist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tracefs-sqlhist.c b/src/tracefs-sqlhist.c
index 0f678c1..08bd0fa 100644
--- a/src/tracefs-sqlhist.c
+++ b/src/tracefs-sqlhist.c
@@ -1109,7 +1109,7 @@ static int build_filter(struct tep_handle *tep, struct sqlhist_bison *sb,
 			     const char *val);
 	struct filter *filter = &expr->filter;
 	enum tracefs_compare cmp;
-	const char *val;
+	const char *val = NULL;
 	int and_or = TRACEFS_FILTER_AND;
 	char num[64];
 	int ret;
-- 
2.44.0





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux