From nobody Sun Apr 28 21:34:43 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.zoho.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 1491834192981757.43437471576; Mon, 10 Apr 2017 07:23:12 -0700 (PDT) Received: from localhost ([::1]:34698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxaDS-0001D5-4K for importer@patchew.org; Mon, 10 Apr 2017 10:22:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxaCI-0000fo-0M for qemu-devel@nongnu.org; Mon, 10 Apr 2017 10:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxaCE-0003NH-2G for qemu-devel@nongnu.org; Mon, 10 Apr 2017 10:21:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57246) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cxaCD-0003N5-SY for qemu-devel@nongnu.org; Mon, 10 Apr 2017 10:21:33 -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 06508C05678E for ; Mon, 10 Apr 2017 14:21:32 +0000 (UTC) Received: from localhost (unknown [10.41.1.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B5F59F33E; Mon, 10 Apr 2017 14:21:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 06508C05678E Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 06508C05678E From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 10 Apr 2017 16:21:12 +0200 Message-Id: <20170410142112.11550-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 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.32]); Mon, 10 Apr 2017 14:21:32 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PATCH] test-keyval: fix leaks 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- tests/test-keyval.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-keyval.c b/tests/test-keyval.c index ba19560a22..141ee5d0c4 100644 --- a/tests/test-keyval.c +++ b/tests/test-keyval.c @@ -628,6 +628,7 @@ static void test_keyval_visit_alternate(void) visit_type_AltNumStr(v, "a", &ans, &error_abort); g_assert_cmpint(ans->type, =3D=3D, QTYPE_QSTRING); g_assert_cmpstr(ans->u.s, =3D=3D, "1"); + qapi_free_AltNumStr(ans); visit_type_AltNumInt(v, "a", &ani, &err); error_free_or_abort(&err); visit_end_struct(v, NULL); @@ -649,11 +650,14 @@ static void test_keyval_visit_any(void) visit_type_any(v, "a", &any, &error_abort); qlist =3D qobject_to_qlist(any); g_assert(qlist); + qobject_decref(any); qstr =3D qobject_to_qstring(qlist_pop(qlist)); g_assert_cmpstr(qstring_get_str(qstr), =3D=3D, "null"); + QDECREF(qstr); qstr =3D qobject_to_qstring(qlist_pop(qlist)); g_assert_cmpstr(qstring_get_str(qstr), =3D=3D, "1"); g_assert(qlist_empty(qlist)); + QDECREF(qstr); visit_check_struct(v, &error_abort); visit_end_struct(v, NULL); visit_free(v); --=20 2.12.0.191.gc5d8de91d