From nobody Wed Nov 27 04:37: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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1700839554; cv=none; d=zohomail.com; s=zohoarc; b=lAnFlQWTJo+nvEtIlZR4HPltrGDlIP7Juuqq93dPpe3OLrttAqc9ogK2dSVVJT7ssn/r9pFHEH2D/2IBXcxmuGmJo+RNgjgNv7XRgAgJ2UEgEOsomAuA9Z6SqSkfzm4SmDxr9yxvn35LAy4mPkagX6YCBSLxqhUdJodTBGEkfIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700839554; 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=TtFo/B8xEGoyrSgNCfhRFu5ifrwebiHFtXFyMhpJy0A=; b=aLd+YWlWY7C3tcNbPtkAvcHudIe61rXNl4VdRPPvpWHW2BSAhScXqBNDFs/VyzKpTKSVCaxLvU8BXYdkV1IkQZs5n9NQMHpvHynUGJxxI/S2pmkHEw6BVWc1I09gxfzAfNwwr253vfHq26hYPN+Bo/or2uXqqc7YTz2bWDLdbUs= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700839554424925.2540101118367; Fri, 24 Nov 2023 07:25:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6Y2g-0004hF-U3; Fri, 24 Nov 2023 10:24:30 -0500 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 1r6Y2f-0004h3-Fu for qemu-devel@nongnu.org; Fri, 24 Nov 2023 10:24:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6Y2e-0004Ay-1k for qemu-devel@nongnu.org; Fri, 24 Nov 2023 10:24:29 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-511-FpPuOUWJOa-exYUWgJhYlQ-1; Fri, 24 Nov 2023 10:24:26 -0500 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-41e58a33efaso20633001cf.2 for ; Fri, 24 Nov 2023 07:24:26 -0800 (PST) Received: from [10.201.49.108] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id z22-20020a05622a029600b00423907c8ce4sm1091091qtw.33.2023.11.24.07.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700839467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TtFo/B8xEGoyrSgNCfhRFu5ifrwebiHFtXFyMhpJy0A=; b=M9LtCLO0JVej3VTAdbBIxGD/pDVuKKOm4lVVHMAAos7/ctdJ4eGBorfX0G3teBaAgoOXA0 JfUrS2nIeAS812Q5kjXNGUI3UR2uYAyPLi7UIHKCQ2ae7eUq+3QpIHUyK+DmFI/mYcIxbF qk3qzUu64qfKOPWTOFTjPAWepapIkfc= X-MC-Unique: FpPuOUWJOa-exYUWgJhYlQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700839465; x=1701444265; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TtFo/B8xEGoyrSgNCfhRFu5ifrwebiHFtXFyMhpJy0A=; b=s6yX7ZdaF6mWCPOGNORhsGIp4ZfocdOc8k1P7yAR1mBJ28gny9gMGFnVNoBfROO48t sFaO0ohsK1tVtZH3E7E0Jd7cuJa39EvmGT7WnZVSJafr67bmPAGySbccAgkcIQ+a63wc iA7pu6ROTzVR6jjAHi3R4bfB97iMLKkZ0hvYubQiZW0Tjmv5O7PgmHik3vTM7D0HgavV Y+bWRpczJkKSqt674zmvduohszpvEyujurIELfiO0+aDt7Bip2z1eLNRRC9tIIa+Vn4P EmGWl/IcuYfh2sl/p3R2Jyl7GW4EWdk4dg1JIeg5NzqIEeztwyZDbWYFv3ea/8CIPnwy nsKw== X-Gm-Message-State: AOJu0Yy89vsf6cJOLPHproTYLEV8mh1gwa8ZC6qeba5ySZbIZhi6oVD/ 1JpzHViMq/K3RiZGpRcJpvKL/5YL2Mg/uW9HbpIYmhCIIj9JgFjKWXXczOYPchtCg0GSgxMqIzG 3lR/26B7vxFxVB9JGW62mypD/6+sFZZNW+QUTI81ej0zYpI6wH/xQGeP5/EjnPigBDftwpKTKLo w= X-Received: by 2002:a05:622a:1821:b0:421:c6ef:4b0b with SMTP id t33-20020a05622a182100b00421c6ef4b0bmr4119257qtc.17.1700839465164; Fri, 24 Nov 2023 07:24:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IExNFtjHzw112K/xwDb+0o4b4NY0Vfb34g4hUo7i9WZ6PuxyGylNq+BEXNaYpHWs5qCnzTFbQ== X-Received: by 2002:a05:622a:1821:b0:421:c6ef:4b0b with SMTP id t33-20020a05622a182100b00421c6ef4b0bmr4119225qtc.17.1700839464762; Fri, 24 Nov 2023 07:24:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 06/10] audio: Free consumed default audio devices Date: Fri, 24 Nov 2023 16:24:04 +0100 Message-ID: <20231124152408.140936-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231124152408.140936-1-pbonzini@redhat.com> References: <20231124152408.140936-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @redhat.com) X-ZM-MESSAGEID: 1700839555895100003 From: Akihiko Odaki Failed default audio devices were removed from the list but not freed, and that made LeakSanitizer sad. Free default audio devices as they are consumed. Signed-off-by: Akihiko Odaki Acked-by: Marc-Andr=C3=A9 Lureau Message-ID: <20231120112804.9736-1-akihiko.odaki@daynix.com> Signed-off-by: Paolo Bonzini --- audio/audio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio/audio.c b/audio/audio.c index f91e05b72c9..8d1e4ad9227 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1758,12 +1758,15 @@ static AudioState *audio_init(Audiodev *dev, Error = **errp) goto out; } s->dev =3D dev =3D e->dev; + QSIMPLEQ_REMOVE_HEAD(&default_audiodevs, next); + g_free(e); drvname =3D AudiodevDriver_str(dev->driver); driver =3D audio_driver_lookup(drvname); if (!audio_driver_init(s, driver, dev, NULL)) { break; } - QSIMPLEQ_REMOVE_HEAD(&default_audiodevs, next); + qapi_free_Audiodev(dev); + s->dev =3D NULL; } } =20 --=20 2.43.0