From 7a205e25ac3b3a69bb12316a096eb1bab35a2702 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 18 Mar 2021 11:08:16 +1000 Subject: [PATCH] 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 --- bench/rules.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bench/rules.c b/bench/rules.c index 3206583..1306dc4 100644 --- a/bench/rules.c +++ b/bench/rules.c @@ -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);