From nobody Sun Feb 8 18:15:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1606245672; cv=none; d=zohomail.com; s=zohoarc; b=VBdVXzFHZY5rpDeCmnRh0HwJ94lsPndmryJkyV50ubF1TSO3aPtDTPnoMPq0E+F3W9yQ2kSJgEQvhYWQpQ42KcTqkhs/Q7kAzViAt8uBSrq4cd7S2e+2+0ApDVU7EoIPvky4AsfgmNtq9bnk1OSzEg1DFlwZPwt7Ft1/ID60xsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606245672; 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=DrhMy5JWXNMzPGLhHMvxaBYM3MLaXyJEFg5KNzfg6BY=; b=MuAfbEXiNBUM7A53wK5ySNbrQniOWPMVYMZGJvfbI8xShaK4XDhaN+e+3bNowQssrTfF6k3SGNnMB7knesiqdBKLD3+iAx5izuUjRxLIWGo1Qs/fSyFl289y4scjWFhkooBbvwBsyrF5HyWnSpttF6VkNUYzBNzPWRDMtMDkUR4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606245672990754.5587094240877; Tue, 24 Nov 2020 11:21:12 -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-290-laf61vQBNSutgRt89Viwnw-1; Tue, 24 Nov 2020 14:21:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1ABE81084C84; Tue, 24 Nov 2020 19:21:04 +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 EC312189A4; Tue, 24 Nov 2020 19:21:03 +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 B4F621809CA1; Tue, 24 Nov 2020 19:21:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AOJL27u004077 for ; Tue, 24 Nov 2020 14:21:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5373A2026D38; Tue, 24 Nov 2020 19:21:02 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C3B02026D35 for ; Tue, 24 Nov 2020 19:20:57 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C14E185A794 for ; Tue, 24 Nov 2020 19:20:57 +0000 (UTC) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-05uEF8iYMomftdcgWsvP6Q-1; Tue, 24 Nov 2020 14:20:55 -0500 Received: by mail-qk1-f182.google.com with SMTP id u184so7543170qkf.3 for ; Tue, 24 Nov 2020 11:20:55 -0800 (PST) Received: from rekt.redhat.com ([2804:431:c7c7:d88a:482:7c39:5cca:96f6]) by smtp.gmail.com with ESMTPSA id l79sm88837qke.1.2020.11.24.11.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 11:20:53 -0800 (PST) X-MC-Unique: laf61vQBNSutgRt89Viwnw-1 X-MC-Unique: 05uEF8iYMomftdcgWsvP6Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DrhMy5JWXNMzPGLhHMvxaBYM3MLaXyJEFg5KNzfg6BY=; b=XczX33WuiEqd1juw01QzPVuRBh6292J5QueUCVJx46vYp1TgvDex6Gdvqyx7PbDIZP iRYxrENF9zkVHQNgpfLTu73z8phXKDuz8+V/MwegUtd3i9v+wGcwrU1/BkiZu/fHDDaj uBF6RpAuQzdXYu1CxEoM2G6kK9oxEndfUWTHV2apg3wvagFa2YbKLYXfrHkmguIQG/5B pdXB+C2d+p+Ynfm/pGhmE7YUP8XvKH+rHs1RWRSvoiMBVtP99VyOr6Go4LBUmGKwUZFa PMZtfE2V5ZPZ8unA2JGOqua4EEUlE16YwPesVA6x5f8MxA8sQ43aPlRQtvrrnFB0tAg/ I8dg== X-Gm-Message-State: AOAM532Soa8FtZN8kReNqhuvS9u5edOrYG0s9Z/CrSUwZU9pLyY12etW rE8YCx4a8g6j6+Cj0ztD3a93/OongRE= X-Google-Smtp-Source: ABdhPJyklhXhprdMutxauRD0OX0p9+KbiW7pJAhbRu0MwGCKTulOx1dQy/hcG6ki8I0Acmdh1PsNmA== X-Received: by 2002:a37:a694:: with SMTP id p142mr6190056qke.467.1606245654488; Tue, 24 Nov 2020 11:20:54 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 02/21] domain_conf.c: use g_autofree in 'dev' in virDomainDefParseBootXML() Date: Tue, 24 Nov 2020 16:20:16 -0300 Message-Id: <20201124192035.2343063-3-danielhb413@gmail.com> In-Reply-To: <20201124192035.2343063-1-danielhb413@gmail.com> References: <20201124192035.2343063-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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.11 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 Content-Type: text/plain; charset="utf-8" This spares us of 2 explicit VIR_FREE() calls. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5e5905f483..4229add26d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18908,7 +18908,7 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, =20 for (i =3D 0; i < n && i < VIR_DOMAIN_BOOT_LAST; i++) { int val; - char *dev =3D virXMLPropString(nodes[i], "dev"); + g_autofree char *dev =3D virXMLPropString(nodes[i], "dev"); if (!dev) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing boot device")); @@ -18918,10 +18918,8 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown boot device '%s'"), dev); - VIR_FREE(dev); return -1; } - VIR_FREE(dev); def->os.bootDevs[def->os.nBootDevs++] =3D val; } =20 --=20 2.26.2