From nobody Thu May 2 12:36:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 148662991493220.33093993666182; Thu, 9 Feb 2017 00:45:14 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v198ffvx028772; Thu, 9 Feb 2017 03:41:42 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v198feZU009369 for ; Thu, 9 Feb 2017 03:41:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id C8DC1B5099; Thu, 9 Feb 2017 08:41:40 +0000 (UTC) Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DFBBB5092 for ; Thu, 9 Feb 2017 08:41:40 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 58900100442; Thu, 9 Feb 2017 09:41:39 +0100 (CET) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 9 Feb 2017 09:41:37 +0100 Message-Id: <54771f831b2b8178e56f1f4415a93e955856848b.1486629697.git.jdenemar@redhat.com> Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] cpu_x86: Fix memory leak in virCPUx86Translate X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" virCPUDefStealModel is called with keepVendor =3D=3D true which means the cpu structure will keep its original vendor/vendor_id values. Thus it makes no sense to copy them to the translated definition as they won't be used there anyway. Except that the translated->vendor pointer might get lost in x86Decode. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 23a519ec0..9e22f896e 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2709,10 +2709,6 @@ virCPUx86Translate(virCPUDefPtr cpu, if (!(translated =3D virCPUDefCopyWithoutModel(cpu))) goto cleanup; =20 - if (VIR_STRDUP(translated->vendor, cpu->vendor) < 0 || - VIR_STRDUP(translated->vendor_id, cpu->vendor_id) < 0) - goto cleanup; - if (x86Decode(translated, &model->data, models, nmodels, NULL, 0) < 0) goto cleanup; =20 --=20 2.11.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list