From nobody Fri May 3 19:48:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568879775; cv=none; d=zoho.com; s=zohoarc; b=gtLgzW1FQSMyRzJmEtHxC6El7Zwc1EyyMI15ETQsfJ+O3JhI8hKTobsAK8PS1JLpZkrgC8WYio/4NaKZBjk6A+/fIpVizrVIYPSEmtAMJJZ1DtD+9lwOqEcJ5AsMR1rRKtCvkbvfopN/Hv1YmMKr0u11M4STg/w5uAFr7/q05Xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568879775; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=h2CgdLxbcXE7WZbKz9Dn9PJEWcuq+MrMHhcUeCeXb/Y=; b=FVpOmspcyvyhwus3yI0FIDm+yk0oo3y5brOfi9iCdiwccP/VXFTgs1kxmLMIP/+sJ0w5TFBIzFozN1M+mns3I2RNziAK5q7Xx/Sqc8aa5TdNmF9fxlfDEHiW/Rd7clFs6c8HuWkmmBNlhObUr0PdeOYLX6ZLVvK0XnUOFSxZnAY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568879775178480.5615767898231; Thu, 19 Sep 2019 00:56:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D5ED308FBA0; Thu, 19 Sep 2019 07:56:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46A7A6012E; Thu, 19 Sep 2019 07:56:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0CBD84EDA6; Thu, 19 Sep 2019 07:56:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8J7u9Dp032523 for ; Thu, 19 Sep 2019 03:56:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id A11FB6012C; Thu, 19 Sep 2019 07:56:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A0BF600CC for ; Thu, 19 Sep 2019 07:56:07 +0000 (UTC) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EAD5300BCE9 for ; Thu, 19 Sep 2019 07:56:06 +0000 (UTC) Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1B9F2FF36A2696D62B76 for ; Thu, 19 Sep 2019 15:56:02 +0800 (CST) Received: from localhost (10.175.124.177) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Thu, 19 Sep 2019 15:55:52 +0800 From: Xu Yandong To: Date: Thu, 19 Sep 2019 04:01:16 -0400 Message-ID: <1568880076-87987-1-git-send-email-xuyandong2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.177] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 19 Sep 2019 07:56:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 19 Sep 2019 07:56:06 +0000 (UTC) for IP:'45.249.212.190' DOMAIN:'szxga04-in.huawei.com' HELO:'huawei.com' FROM:'xuyandong2@huawei.com' RCPT:'' X-RedHat-Spam-Score: -2.302 (RCVD_IN_DNSWL_MED, SPF_HELO_PASS, SPF_PASS) 45.249.212.190 szxga04-in.huawei.com 45.249.212.190 szxga04-in.huawei.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Xu Yandong , zhang.zhanghailiang@huawei.com Subject: [libvirt] [PATCH] conf: use virDomainDeviceDefFree free dev 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 19 Sep 2019 07:56:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In function virDomainDeviceDefParse, we shoud use virDomainDeviceDefFree free data structure avoid potential memory leak. Signed-off-by: Xu Yandong Reviewed-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 848c831330..8fb9480827 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16504,7 +16504,8 @@ virDomainDeviceDefParse(const char *xmlStr, return dev; =20 error: - VIR_FREE(dev); + virDomainDeviceDefFree(dev); + dev =3D NULL; goto cleanup; } =20 --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list