bench: silence coverity complaint about a double free

False positive because we rely on xkb_components_from_rules() to initalize this
struct, but let's localize the variable anyway to shut coverity up.

libxkbcommon-1.0.3/bench/rules.c:59:9: warning[-Wanalyzer-double-free]:
double-free of kccgst.symbols

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
master
Peter Hutterer 2021-03-18 11:08:16 +10:00 committed by Ran Benita
parent 21c864ccbf
commit 7a205e25ac
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,6 @@ main(int argc, char *argv[])
struct xkb_rule_names rmlvo = {
"evdev", "pc105", "us,il", ",", "ctrl:nocaps,grp:menu_toggle",
};
struct xkb_component_names kccgst;
struct bench bench;
char *elapsed;
@ -52,6 +51,8 @@ main(int argc, char *argv[])
bench_start(&bench);
for (i = 0; i < BENCHMARK_ITERATIONS; i++) {
struct xkb_component_names kccgst;
assert(xkb_components_from_rules(ctx, &rmlvo, &kccgst));
free(kccgst.keycodes);
free(kccgst.types);