From nobody Mon Feb 9 10:50:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1614085529; cv=none; d=zohomail.com; s=zohoarc; b=CKJf8609gQMsnNxGXwAO8M+7PqzkgmbM9hnJHcir9tRJLNouP4V7xsFxmJNpFT8n7cGeleU/K4aVP/xZUIlH79385nRNDq6p4/JnELktDwpi/wlHgdQt7rR5yuVMAe2nSudUte/gQBDnurABXDksSKDjXTY6CYvfmktUoMda+Eg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614085529; 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=Z9SzVrt7cHaLv1h8dY2lU8AYRwrMjPbV57Kes51OtJc=; b=diExT2Zfpbftalf/ZMjrU+z/P72Adx99Iice+Az9HBjBFKhjiFNzq3TYDq1rLxNa7iROtWbK3CO+ppdBbZWgAUud/ATEaH5s8Nq1oR1U63UGEx5yO8GU2TnA7jEdnzU9vvQrn/t6GEJFEPL+si6uaZMV6BVfcla5Ii+UQXq4dqc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614085529508658.0310944774498; Tue, 23 Feb 2021 05:05:29 -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-397-6AapNo39PAyXap9LgigEOA-1; Tue, 23 Feb 2021 08:05:26 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C2AA1936B78; Tue, 23 Feb 2021 13:05:20 +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 6D8E660C04; Tue, 23 Feb 2021 13:05:20 +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 2920C18095CD; Tue, 23 Feb 2021 13:05:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11ND58ha010219 for ; Tue, 23 Feb 2021 08:05:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id E3E5A60C47; Tue, 23 Feb 2021 13:05:08 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.194.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B0F760C04 for ; Tue, 23 Feb 2021 13:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614085528; 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=Z9SzVrt7cHaLv1h8dY2lU8AYRwrMjPbV57Kes51OtJc=; b=TL1oRmo1zTaSdxAfWdXIRvMoBQwXd5ih3kckeUJbDD0nDMQjINoNh4IwCgH3d1kbW1PkKo 0xKE89fx+sbQisHtFpISdj1SDxkpiWKv5MQDMAX9dybt7pkTM9eGy9aZB0CYN3/MSgrpa4 ZMD6yekhI0gCHY5BsR+N1l1pRtA3izU= X-MC-Unique: 6AapNo39PAyXap9LgigEOA-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 2/4] netdev_bandwidth_conf: Use g_autofree where possible Date: Tue, 23 Feb 2021 14:04:46 +0100 Message-Id: <55dc48bfa71ed3624996c59bd02926ecbacb6270.1614085265.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.79 on 10.5.11.12 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Kristina Hanicova Reviewed-by: J=C3=A1n Tomko --- src/conf/netdev_bandwidth_conf.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/conf/netdev_bandwidth_conf.c b/src/conf/netdev_bandwidth_c= onf.c index 4fb7aa4e3d..1ff3785677 100644 --- a/src/conf/netdev_bandwidth_conf.c +++ b/src/conf/netdev_bandwidth_conf.c @@ -29,10 +29,10 @@ static int virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRatePtr rat= e) { int ret =3D -1; - char *average =3D NULL; - char *peak =3D NULL; - char *burst =3D NULL; - char *floor =3D NULL; + g_autofree char *average =3D NULL; + g_autofree char *peak =3D NULL; + g_autofree char *burst =3D NULL; + g_autofree char *floor =3D NULL; =20 if (!node || !rate) { virReportError(VIR_ERR_INVALID_ARG, "%s", @@ -88,11 +88,6 @@ virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBa= ndwidthRatePtr rate) ret =3D 0; =20 cleanup: - VIR_FREE(average); - VIR_FREE(peak); - VIR_FREE(burst); - VIR_FREE(floor); - return ret; } =20 @@ -119,7 +114,7 @@ virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidt= h, virNetDevBandwidthPtr def =3D NULL; xmlNodePtr cur; xmlNodePtr in =3D NULL, out =3D NULL; - char *class_id_prop =3D NULL; + g_autofree char *class_id_prop =3D NULL; =20 def =3D g_new0(virNetDevBandwidth, 1); =20 @@ -210,7 +205,6 @@ virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidt= h, ret =3D 0; =20 cleanup: - VIR_FREE(class_id_prop); virNetDevBandwidthFree(def); return ret; } --=20 2.29.2