libtracefs: Fix sqlhist used uninitialized error
PATCH 1/1 libtracefs: Fix sqlhist used uninitialized error
Fix the following used uninitialized error detected by clang:
```
src/tracefs-sqlhist.c:657:13: error: variable 'extra_label' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
657 | } else if (expr == table->from) {
| ^~~~~~~~~~~~~~~~~~~
src/tracefs-sqlhist.c:662:6: note: uninitialized use occurs here
662 | if (extra_label)
| ^~~~~~~~~~~
src/tracefs-sqlhist.c:657:9: note: remove the 'if' if its condition is always true
657 | } else if (expr == table->from) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
src/tracefs-sqlhist.c:645:25: note: initialize the variable 'extra_label' to silence this warning
645 | const char *extra_label;
| ^
| = NULL
1 error generated.
```Signed-off-by Ian Rogers <[email protected]>
--- src/tracefs-sqlhist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/tracefs-sqlhist.c +1 -1
@@ -642,7 +642,7 @@ static int update_vars(struct tep_handle *tep,enum field_type ftype =FIELD_NONE ;struct tep_event *event;struct field *field; -const char *extra_label; +const char *extra_label =NULL ;const char *label;const char *raw = event_field->raw;const char *event_name;
Signature · 1 line
2.43.0.472.g3155946c3a-goog