From nobody Sun Feb 8 01:09:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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=1583425935; cv=none; d=zohomail.com; s=zohoarc; b=eeBFb+pc/R/m/rQuOjzHO0lPQfF8kSFFn9c9HZ4Q3NvdRnbjtxssgMETW1tcHmfBCioFH4mbXGVijTWW5N/lu/aQMfYIDIAnNGKqvC+BrU/VmJBRAJacwJZlXLfIQ8/ZX61j/LHIjg+Qqny5QGjdH5XTf47TSy1Hy8BP86JUkd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583425935; 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=milcUWWBpuWgAD66RMOUNHWZMSlnthgW/u4DlV5URls=; b=FgPbo6BolgILRxnb4nGvoM8vPbvpRKOEIFxxgLFVDgRPHp4kG4oKyBwwNUgoE+FNmJEKG3kZlWKR3oHfMYuCIEIwmfZ1sgCF5dOTCVdpyeJX7N1rpx6zvzZ0KqwWyMMnt45a31VnWrI/TDXrEg0nqq12I8f9lhqr0Pz3+3aK6H0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 158342593535489.95199744835236; Thu, 5 Mar 2020 08:32:15 -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-404-E2M7v4OnMNqEC5KnHZgXeg-1; Thu, 05 Mar 2020 11:32:11 -0500 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 E194A107ACC4; Thu, 5 Mar 2020 16:32:05 +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 AA6A5277A4; Thu, 5 Mar 2020 16:32:05 +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 4A11418089D0; Thu, 5 Mar 2020 16:32:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 025GVh2r023220 for ; Thu, 5 Mar 2020 11:31:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7E8605C21B; Thu, 5 Mar 2020 16:31:43 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.43.2.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04BAB5C557 for ; Thu, 5 Mar 2020 16:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583425934; 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=milcUWWBpuWgAD66RMOUNHWZMSlnthgW/u4DlV5URls=; b=Du/h35YSJei33e1NbwhRFEnAn9NZxxUYMDDfto0YHSEWnQpMWADZNCsc4RsggzFbbZcW7Y dqa/BUFx40YTJulkhT2h9EJu7jfAjVuzVCT38nm6R+D6UapVataoUkxI4oZnPiZ/g3ReoD +SmzDa0XRf2D0AJCMLBavr4HS7+bZAY= X-MC-Unique: E2M7v4OnMNqEC5KnHZgXeg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] virmacmap: Use g_autofree in virMacMapWriteFileLocked Date: Thu, 5 Mar 2020 17:31:33 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 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" Signed-off-by: J=C3=A1n Tomko --- src/util/virmacmap.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c index 0c0ba90def..4a57edede8 100644 --- a/src/util/virmacmap.c +++ b/src/util/virmacmap.c @@ -261,19 +261,15 @@ static int virMacMapWriteFileLocked(virMacMapPtr mgr, const char *file) { - char *str; - int ret =3D -1; + g_autofree char *str =3D NULL; =20 if (virMacMapDumpStrLocked(mgr, &str) < 0) - goto cleanup; + return -1; =20 if (virFileRewriteStr(file, 0644, str) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - cleanup: - VIR_FREE(str); - return ret; + return 0; } =20 =20 --=20 2.24.1