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
parent
21c864ccbf
commit
7a205e25ac
|
@ -40,7 +40,6 @@ main(int argc, char *argv[])
|
||||||
struct xkb_rule_names rmlvo = {
|
struct xkb_rule_names rmlvo = {
|
||||||
"evdev", "pc105", "us,il", ",", "ctrl:nocaps,grp:menu_toggle",
|
"evdev", "pc105", "us,il", ",", "ctrl:nocaps,grp:menu_toggle",
|
||||||
};
|
};
|
||||||
struct xkb_component_names kccgst;
|
|
||||||
struct bench bench;
|
struct bench bench;
|
||||||
char *elapsed;
|
char *elapsed;
|
||||||
|
|
||||||
|
@ -52,6 +51,8 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
bench_start(&bench);
|
bench_start(&bench);
|
||||||
for (i = 0; i < BENCHMARK_ITERATIONS; i++) {
|
for (i = 0; i < BENCHMARK_ITERATIONS; i++) {
|
||||||
|
struct xkb_component_names kccgst;
|
||||||
|
|
||||||
assert(xkb_components_from_rules(ctx, &rmlvo, &kccgst));
|
assert(xkb_components_from_rules(ctx, &rmlvo, &kccgst));
|
||||||
free(kccgst.keycodes);
|
free(kccgst.keycodes);
|
||||||
free(kccgst.types);
|
free(kccgst.types);
|
||||||
|
|
Loading…
Reference in New Issue