From nobody Tue Feb 10 02:49:35 2026 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=1576749968; cv=none; d=zohomail.com; s=zohoarc; b=aeVQ1k9V4+7LMEgkZa8c+GMdDxnYQ6ogP2BMLKU61k2J7/TvzBfguSMnWpmXyPnsBiJkvtYFRLJiTCwxZtqwrNaXQ3cPs/tDRj8ZqHdgyUdqzFW0aC6UKKndMOHN3yXLopZbJRJoKK8jQwl5uhXyPT/IGw9uWtnLUSNdsqcpFBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576749968; 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=94Im+BCfVWgwkRWKh5MKK+TnIRS0CM485vY6RZimT+M=; b=Mm+HgFwbgxcQXecGrb7AKaclFtS4aQ8xARk+VEh/FmX5flUJy4zBn+7E7wUoAQtCMUJonWcD0LOJWlzdDgywtV3cTyjwSBTZgInD7EFjuBvUncPk7SGsrImpiArPwvX23R+vBEuBkxSkj97xnLxDQsHiDlOyQ483Sg9DFalSDes= 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 1576749968569198.48197323490865; Thu, 19 Dec 2019 02:06:08 -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-321-f7VVXvuePy-NnWwIziFBUQ-1; Thu, 19 Dec 2019 05:06:05 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34271DB66; Thu, 19 Dec 2019 10:05:56 +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 127055C1B0; Thu, 19 Dec 2019 10:05:56 +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 C076818034FF; Thu, 19 Dec 2019 10:05:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBJA5bCW011139 for ; Thu, 19 Dec 2019 05:05:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3369126E55; Thu, 19 Dec 2019 10:05:37 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86E3D26DF9; Thu, 19 Dec 2019 10:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576749967; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=94Im+BCfVWgwkRWKh5MKK+TnIRS0CM485vY6RZimT+M=; b=DCV706lwUshneAVr8oRYjrNyPsY6n0Bxl7knvq4JFUvy77VLo5Eesg62LrecZP+xCk2Kea Yq93YJJaGoQQJB3APwCz8yy/xA9mumq//gJbF1RvB/8JRdExfPTaCf9tJ03UQrRae/7ayh 25dG6lAI87k4Rbk0r9tHr/xb3YtnKj0= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 19 Dec 2019 11:04:39 +0100 Message-Id: <20191219100447.210836-35-fidencio@redhat.com> In-Reply-To: <20191219100447.210836-1-fidencio@redhat.com> References: <20191219100447.210836-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [PATCH 34/42] logging: Use g_autofree on virLogDaemonExecRestartStatePath() 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.79 on 10.5.11.16 X-MC-Unique: f7VVXvuePy-NnWwIziFBUQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Together with the change, let's also simplify the function and get rid of the goto. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: J=C3=A1n Tomko --- src/logging/log_daemon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index d41d9caba9..3fee2b3b57 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -612,29 +612,23 @@ virLogDaemonExecRestartStatePath(bool privileged, if (privileged) { *state_file =3D g_strdup(RUNSTATEDIR "/virtlogd-restart-exec.json"= ); } else { - char *rundir =3D NULL; + g_autofree char *rundir =3D NULL; mode_t old_umask; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) - goto error; + return -1; =20 old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { umask(old_umask); - VIR_FREE(rundir); - goto error; + return -1; } umask(old_umask); =20 *state_file =3D g_strdup_printf("%s/virtlogd-restart-exec.json", r= undir); - - VIR_FREE(rundir); } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list