From nobody Sun Apr 28 00:57:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583427498; cv=none; d=zohomail.com; s=zohoarc; b=hnF4DkuQuANv6glZ3SwzloK6c/fvDBODlE96hLWdVaND2WUTIyoYLfjN80IXiMIEfLneOXYUDAvE+/BlbHqL+USooE3Bzp/6Qo+BgalcjvG3P8/pgOAnERiLMsINhLuFx+4pWfTDhrU9ew8QRY6N1+87qbJgnxW7dFhc7h81EHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583427498; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=O0YOr5GaZPWdzB6f4O8pOqS3970mG/CQjrKVEtvdO9E=; b=K/vKFwKUwMEfZW4DzPuvD3Oog+jqVNa+Ka4CFAc1y2JC1YGhPtQd3PNf8IuY7+511Hove6tP1TeStA0PcDRsGZBmu/ZVTouJL2W8DrB/vd/IqmMm1Pe/TXyYWVdovNGuhoGXFZ2VXuGr1M0ojNJ0V5a722Kbr+XHAryh8ZECLPY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1583427498734507.54741152951374; Thu, 5 Mar 2020 08:58:18 -0800 (PST) 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-319-L3-8zRevO0eVv4-5RGkCcg-1; Thu, 05 Mar 2020 11:58:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F06CDB60; Thu, 5 Mar 2020 16:58:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 197931001902; Thu, 5 Mar 2020 16:58:09 +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 9ED4C18089CE; Thu, 5 Mar 2020 16:58:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 025Gw6VT026105 for ; Thu, 5 Mar 2020 11:58:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id A0D631001B2B; Thu, 5 Mar 2020 16:58:06 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9ECD1001902; Thu, 5 Mar 2020 16:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583427497; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=O0YOr5GaZPWdzB6f4O8pOqS3970mG/CQjrKVEtvdO9E=; b=hf3a1OhdqndAtRGkpTErU4sKQKYscBVPDtnfSmrPeQCLHABmRPprs0GIoc90LfVmbfYez9 1dg2wgWHRJJr7uIknF/bEQr4kBIugbXVoGE3kgtKBGc3PS0Z+BQ0yOSJbVd2lUFARKDYD2 28WiBTBW9xD01kPmYWeNa1rKQUhMoBY= X-MC-Unique: L3-8zRevO0eVv4-5RGkCcg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH] test: fix leak of authentication info Date: Thu, 5 Mar 2020 16:58:01 +0000 Message-Id: <20200305165801.2747491-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The 'auths' struct in the test driver was not free()d. This was easy to miss because the default XML doesn't include auth info. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Daniel Henrique Barboza --- src/test/test_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 029d560fb9..73fe1ad6ce 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -156,6 +156,7 @@ static void testDriverDispose(void *obj) { testDriverPtr driver =3D obj; + size_t i; =20 virObjectUnref(driver->caps); virObjectUnref(driver->xmlopt); @@ -165,6 +166,11 @@ testDriverDispose(void *obj) virObjectUnref(driver->ifaces); virObjectUnref(driver->pools); virObjectUnref(driver->eventState); + for (i =3D 0; i < driver->numAuths; i++) { + g_free(driver->auths[i].username); + g_free(driver->auths[i].password); + } + g_free(driver->auths); } =20 typedef struct _testDomainNamespaceDef testDomainNamespaceDef; --=20 2.24.1