From nobody Sun Feb 8 22:08:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1630784118; cv=none; d=zohomail.com; s=zohoarc; b=YsfHf+YDBPDlrNQE4DNLXQ6VwbAsFE692HCIhFn4SeJeIRlMFedn4MaobgURbsOnpgZSKv+ZoO36ULllltdUpdv1e0WZAq0/22Ylqv9AX+A9f89bJ8MYq5NVnyPwz3851Loj0eNqvYNXCdCHKKxA82T2FP3b3pautXCWqgyUJR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630784118; h=Content-Type:Content-Transfer-Encoding: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=8n4nHnZe+joagJ2ShTIDwDX/CfP4jJDVtwx67C/bod0=; b=LtsybVuN17+JLU/JuYAyJ+Pm48W+WWh63dYfLbV4jhwqwZ0T8V7IyVcbo77CHmjJOxJdt7XEJo3eUOZ+E+mWe7vhXBM/9e22xBTv2cPHKMavF0BLyVUI70r2AdIL62mYrcl74iQm1r9n01/bL/7k7f+YLLDiw8ZpuPdMp9RWc/Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1630784118403523.4770382068072; Sat, 4 Sep 2021 12:35:18 -0700 (PDT) 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-2-IMObCgjYNOetta0nPfL_hA-1; Sat, 04 Sep 2021 15:35:15 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4FD841854E2D; Sat, 4 Sep 2021 19:35:10 +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 2B88C19C59; Sat, 4 Sep 2021 19:35:10 +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 ED7B5180BAA1; Sat, 4 Sep 2021 19:35:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 184JZ5XK002592 for ; Sat, 4 Sep 2021 15:35:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5089E77718; Sat, 4 Sep 2021 19:35:05 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF66478433 for ; Sat, 4 Sep 2021 19:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630784117; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8n4nHnZe+joagJ2ShTIDwDX/CfP4jJDVtwx67C/bod0=; b=MR6rE6PjBzbk6hPAOOH4L/ohYC65lmbvRjBB8FXMcCBeAs0P0JNa+CAP2aq+ZIVIfZmoCM on7KJTmxMOXmJdCX44KpfeDRRvygFvYAoRHa9okXttXNqSyzZs56droBg8/lSrdzAuvobP 0UlfXcJwRwSI6JVbIALKFg6TtSYraYw= X-MC-Unique: IMObCgjYNOetta0nPfL_hA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/6] tests: reduce variable scope in testSELinuxCheckLabels Date: Sat, 4 Sep 2021 21:34:50 +0200 Message-Id: <1e62bd7303ca4f40291b6d2d1d21b0d180caf032.1630784040.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1630784118983100001 And use g_auto. Signed-off-by: J=C3=A1n Tomko --- tests/securityselinuxlabeltest.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabelt= est.c index f7dd3c866a..3d886fd827 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -246,10 +246,9 @@ static int testSELinuxCheckLabels(testSELinuxFile *files, size_t nfiles) { size_t i; - char *ctx; =20 for (i =3D 0; i < nfiles; i++) { - ctx =3D NULL; + g_autofree char *ctx =3D NULL; if (getfilecon(files[i].file, &ctx) < 0) { if (errno =3D=3D ENODATA) { /* nothing to do */ @@ -266,10 +265,8 @@ testSELinuxCheckLabels(testSELinuxFile *files, size_t = nfiles) virReportError(VIR_ERR_INTERNAL_ERROR, "File %s context '%s' did not match expected '%= s'", files[i].file, ctx, files[i].context); - VIR_FREE(ctx); return -1; } - VIR_FREE(ctx); } return 0; } --=20 2.31.1