From nobody Mon Feb 9 23:01:31 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582882197; cv=none; d=zohomail.com; s=zohoarc; b=PDuIfqALWohij2Fvqg4PvrSaoS4Jm4dZbuj2T2sZ1uVuNpmedTg9RO40tfQmjD1VFO074X60mBgyGeS7SGNelPbwP4DmPjAAUSkPauvAjg9MOHFyWPv0/buLWe6BwUNNVwwDjXAXYk5a0/64FjPstBE3DUqc8XoYxnD/1wAqe0A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582882197; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JpLkG+7WfjcbZhptBHkg3m0G9Pr99Px+/VdiiAqiGT8=; b=L9fCSyOjKJCDXTw7atfXLXXeimYAVEuL74+ohaokuni5luQEHPO/Nqj0g/wuX6djDqWGgJcblLhUuWET7bEcwZT+VTaGwk2xSor3Cb3rqV1zAjc9rI815ywVyEwtHE7iFDg2W3qiyQXXdjKXvZjfWi0gBxJR6QUPP9/ZdbhduVk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582882197222290.1946877013611; Fri, 28 Feb 2020 01:29:57 -0800 (PST) Received: from localhost ([::1]:44154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7by0-0007Zs-0o for importer@patchew.org; Fri, 28 Feb 2020 04:29:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50616) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7btg-0008EY-DS for qemu-devel@nongnu.org; Fri, 28 Feb 2020 04:25:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7btf-000465-9J for qemu-devel@nongnu.org; Fri, 28 Feb 2020 04:25:28 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:48391 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7btf-00045p-4P for qemu-devel@nongnu.org; Fri, 28 Feb 2020 04:25:27 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-462-oqMWHx7RMdW5oepGzM8Pog-1; Fri, 28 Feb 2020 04:25:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B0541005514; Fri, 28 Feb 2020 09:25:23 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9734F60BE0; Fri, 28 Feb 2020 09:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582881926; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JpLkG+7WfjcbZhptBHkg3m0G9Pr99Px+/VdiiAqiGT8=; b=DzWuH9wPO8SLfP1fbh3hqmAKotpsMI71gf7JRuPfIrgSpF752bn6wsbbN1q1jva4Y9xruL 6cISU8taR2Jdoy7uxCpgpZfrujJHFOfgGigRqlnV614Tt1bhmUKoMat9UctaD8aBKjVXLl 3tmZPnaOiZ8NXJ6MZz27/+OhGRVfMhc= X-MC-Unique: oqMWHx7RMdW5oepGzM8Pog-1 From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 10/15] test-vmstate: Fix memleaks in test_load_qlist Date: Fri, 28 Feb 2020 10:24:15 +0100 Message-Id: <20200228092420.103757-11-quintela@redhat.com> In-Reply-To: <20200228092420.103757-1-quintela@redhat.com> References: <20200228092420.103757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Fam Zheng , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, Juan Quintela , Euler Robot , "Dr. David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stefan Hajnoczi , Chen Qun , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Hailiang Zhang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Chen Qun There is memleak in test_load_qlist().It's not a big deal, but test-vmstate will fail if sanitizers is enabled. In addition, "ret" is written twice with the same value in test_gtree_load_iommu(). Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Juan Quintela Reviewed-by: Laurent Vivier Signed-off-by: Juan Quintela --- tests/test-vmstate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c index cea363dd69..f7b3868881 100644 --- a/tests/test-vmstate.c +++ b/tests/test-vmstate.c @@ -1241,7 +1241,6 @@ static void test_gtree_load_iommu(void) TestGTreeIOMMU *orig_iommu =3D create_iommu(); QEMUFile *fsave, *fload; char eof; - int ret; =20 fsave =3D open_test_file(true); qemu_put_buffer(fsave, iommu_dump, sizeof(iommu_dump)); @@ -1250,10 +1249,8 @@ static void test_gtree_load_iommu(void) =20 fload =3D open_test_file(false); vmstate_load_state(fload, &vmstate_iommu, dest_iommu, 1); - ret =3D qemu_file_get_error(fload); eof =3D qemu_get_byte(fload); - ret =3D qemu_file_get_error(fload); - g_assert(!ret); + g_assert(!qemu_file_get_error(fload)); g_assert_cmpint(orig_iommu->id, =3D=3D, dest_iommu->id); g_assert_cmpint(eof, =3D=3D, QEMU_VM_EOF); =20 @@ -1395,6 +1392,7 @@ static void test_load_qlist(void) compare_containers(orig_container, dest_container); free_container(orig_container); free_container(dest_container); + qemu_fclose(fload); } =20 typedef struct TmpTestStruct { --=20 2.24.1