From nobody Sun Apr 28 19:47:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522764204502240.4413515969493; Tue, 3 Apr 2018 07:03:24 -0700 (PDT) Received: from localhost ([::1]:36995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3MWq-0003bo-4Q for importer@patchew.org; Tue, 03 Apr 2018 10:03:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3MV1-0002YR-E8 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 10:01:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3MUt-0004CE-T8 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 10:01:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43382) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3MUt-0004BE-OG for qemu-devel@nongnu.org; Tue, 03 Apr 2018 10:01:15 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C656380471; Tue, 3 Apr 2018 14:01:14 +0000 (UTC) Received: from localhost (ovpn-116-15.gru2.redhat.com [10.97.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE1B267011; Tue, 3 Apr 2018 14:01:12 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell Date: Tue, 3 Apr 2018 11:01:06 -0300 Message-Id: <20180403140107.26125-2-ehabkost@redhat.com> In-Reply-To: <20180403140107.26125-1-ehabkost@redhat.com> References: <20180403140107.26125-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 03 Apr 2018 14:01:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/2] exec: fix memory leak in find_max_supported_pagesize() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Greg Kurz , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz The string returned by object_property_get_str() is dynamically allocated. Signed-off-by: Greg Kurz Message-Id: <152231458624.69730.1752893648612848392.stgit@bahia.lan> Reviewed-by: Cornelia Huck Reviewed-by: Thomas Huth Signed-off-by: Eduardo Habkost --- exec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/exec.c b/exec.c index c09bd93df3..02b1efebb7 100644 --- a/exec.c +++ b/exec.c @@ -1495,6 +1495,7 @@ static int find_max_supported_pagesize(Object *obj, v= oid *opaque) mem_path =3D object_property_get_str(obj, "mem-path", NULL); if (mem_path) { long hpsize =3D qemu_mempath_getpagesize(mem_path); + g_free(mem_path); if (hpsize < *hpsize_min) { *hpsize_min =3D hpsize; } --=20 2.14.3 From nobody Sun Apr 28 19:47:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522764364466928.106902100101; Tue, 3 Apr 2018 07:06:04 -0700 (PDT) Received: from localhost ([::1]:37082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3MZX-0005hd-Kb for importer@patchew.org; Tue, 03 Apr 2018 10:06:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3MV5-0002b5-D3 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 10:01:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3MUw-0004Du-0D for qemu-devel@nongnu.org; Tue, 03 Apr 2018 10:01:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40932) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3MUv-0004D6-RJ for qemu-devel@nongnu.org; Tue, 03 Apr 2018 10:01:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 073E181E03; Tue, 3 Apr 2018 14:01:17 +0000 (UTC) Received: from localhost (ovpn-116-15.gru2.redhat.com [10.97.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 315AC7ADDC; Tue, 3 Apr 2018 14:01:16 +0000 (UTC) From: Eduardo Habkost To: Peter Maydell Date: Tue, 3 Apr 2018 11:01:07 -0300 Message-Id: <20180403140107.26125-3-ehabkost@redhat.com> In-Reply-To: <20180403140107.26125-1-ehabkost@redhat.com> References: <20180403140107.26125-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 03 Apr 2018 14:01:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/2] sev/i386: fix memory leak in sev_guest_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Greg Kurz , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz The string returned by object_property_get_str() is dynamically allocated. Fixes: d8575c6c0242b Signed-off-by: Greg Kurz Message-Id: <152231462116.69730.14119625999092384450.stgit@bahia.lan> Reviewed-by: Cornelia Huck Reviewed-by: Thomas Huth Signed-off-by: Eduardo Habkost --- target/i386/sev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 019d84cef2..c01167143f 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -748,9 +748,11 @@ sev_guest_init(const char *id) if (s->sev_fd < 0) { error_report("%s: Failed to open %s '%s'", __func__, devname, strerror(errno)); - goto err; } g_free(devname); + if (s->sev_fd < 0) { + goto err; + } =20 ret =3D sev_platform_ioctl(s->sev_fd, SEV_PLATFORM_STATUS, &status, &fw_error); --=20 2.14.3