From nobody Mon Nov 25 10:26:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1716529060; cv=none; d=zohomail.com; s=zohoarc; b=ZeVX9UWz6G2MFPZUAT6seIFySEKVKfc82JZ/ekPtalfe5xC25iQ97pQCuEruLcImkuBEITh5u7UpwdMwu4UarDfAjR6fa8ejjWz9ddoyMZT4XFLAKkObod8QmJYCmmBGhqpaJV/HyYs2MB+bSgc2/xe3WDx03BXQQovBXwzEjUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716529060; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ktjQT4R7pKWFtbxj3xSZ2/NJzr1LvAGm2r7cio2ONHQ=; b=m7GRJPf52IRzD/eON3RgA+naBPnU7XyY7vh3Ius1dwQUHa2YdUi+vn7OhN0phAqgDn3/LB3vduBQvEYaqkCaACzAM/gy9aMeaushm1N6yw58VVGlP+fdDIY6d/0YN6k0uZ7diNA9BVEu21Cs5E1LQZ++pMmSbm/BpU3+XoVSlKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716529060323668.2974793543265; Thu, 23 May 2024 22:37:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sANbK-00089t-Q7; Fri, 24 May 2024 01:36:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sANbI-00089b-O9 for qemu-devel@nongnu.org; Fri, 24 May 2024 01:36:20 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sANbH-00013w-6O for qemu-devel@nongnu.org; Fri, 24 May 2024 01:36:20 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1f44b45d6abso4001515ad.0 for ; Thu, 23 May 2024 22:36:18 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1f44c75697bsm5260235ad.34.2024.05.23.22.36.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 22:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1716528978; x=1717133778; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ktjQT4R7pKWFtbxj3xSZ2/NJzr1LvAGm2r7cio2ONHQ=; b=rlJKdLW2cU2UfE6g76HOCF8HkidZSG2rfVmvQ8uTgNXi4k8tq+jekuouxVreyoWE7/ lkldnr9wOhH10VnztlLWbCR7b8NFhNPOmPpmw0R1NYH8pa0gkmsxMVerHE0AF+Ty5Bdi xVvEPusiTT4NlCiHxye//uZl9w5AYz7cYStk2KHGtsGVs8A3AXza0OwK52Tp4Z7W3hpk 2Q6pKH0j4Th5TJLUH0u12CInw3OA+BZ4jVRuT6SaZInHSrDYBhjq+rYr2RUhhe5ChVws ElgVuDNzU5041miSKX2cE9pIS7nX6eE92Nk+jifiQaYvhjjRbKSFXJtMBWQM3ly80PBG Ddow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716528978; x=1717133778; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ktjQT4R7pKWFtbxj3xSZ2/NJzr1LvAGm2r7cio2ONHQ=; b=turtUu1J6v7MemSdg80W05/s6zhXm4GsgrNgsqxodkzMA+lWGKeOHds1IfU8M7ilfl MDIfCRso/7Qt7w1g48JeERtkTCW+rK3ng4j8XrbF/bYKH41YuwVnwG7I8u7TAx9wbW3t ir2ltNgYB3T7KxiJEVOdrpabgQ/9peBMQQN4lR331E76khCpLq9rOinuD2NJZkNwDQWB qAWILnrzbbQkq3/8Wd5LGdHfbT5o3OocO9Q3A286WpfrrpJNnQ1PMZUqCHCB1PJSErK2 jPh2BMx32r9Nt+bvPYi8SJN0l2fJqwhiDYZB68WB/d4XZSQASSQtoLPkVeNd97QbQoVJ NrJg== X-Gm-Message-State: AOJu0YwEBlx9Uqg/VCpdrXpA+3sP3kT/wxYW4QPv8gMCUfrv8d1Zwy/Y 8YVl2PAf/iaQQpD89aaBcgywLOi3IBte7sdBOL3EIz2IHIWcZOY7ziaaXM6+8xw= X-Google-Smtp-Source: AGHT+IEFZ+jesRSDpf/pppvd2SVpWqc0Szr2Uz9/jVsqRlDjjtNUrDEY0kJClmvpyIRc2rOKUG4/Kg== X-Received: by 2002:a17:903:41ce:b0:1f4:5477:4bfe with SMTP id d9443c01a7336-1f454774e3cmr2458085ad.69.1716528977932; Thu, 23 May 2024 22:36:17 -0700 (PDT) From: Akihiko Odaki Date: Fri, 24 May 2024 14:35:47 +0900 Subject: [PATCH v4 1/4] qemu-keymap: Make references to allocations static MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240524-xkb-v4-1-2de564e5c859@daynix.com> References: <20240524-xkb-v4-0-2de564e5c859@daynix.com> In-Reply-To: <20240524-xkb-v4-0-2de564e5c859@daynix.com> To: Michael Tokarev , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Wainer dos Santos Moschetta , Beraldo Leal , Richard Henderson , Laurent Vivier Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-01a33 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::632; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1716529062025100001 LeakSanitizer complains about allocations whose references are held only by automatic variables. It is possible to free them to suppress the complaints, but it is a chore to make sure they are freed in all exit paths so make them static instead. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- qemu-keymap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qemu-keymap.c b/qemu-keymap.c index 8c80f7a4ed65..701e4332af87 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -154,9 +154,9 @@ static xkb_mod_mask_t get_mod(struct xkb_keymap *map, c= onst char *name) =20 int main(int argc, char *argv[]) { - struct xkb_context *ctx; - struct xkb_keymap *map; - struct xkb_state *state; + static struct xkb_context *ctx; + static struct xkb_keymap *map; + static struct xkb_state *state; xkb_mod_index_t mod, mods; int rc; =20 @@ -234,8 +234,6 @@ int main(int argc, char *argv[]) =20 state =3D xkb_state_new(map); xkb_keymap_key_for_each(map, walk_map, state); - xkb_state_unref(state); - state =3D NULL; =20 /* add quirks */ fprintf(outfile, --=20 2.45.1