From nobody Tue May 13 22:24:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528400179094424.84769807628595; Thu, 7 Jun 2018 12:36:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 977A5C047B74; Thu, 7 Jun 2018 19:36:17 +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 5C6B73083326; Thu, 7 Jun 2018 19:36:17 +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 B9E9A180BA88; Thu, 7 Jun 2018 19:36:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w57JaDqL019331 for ; Thu, 7 Jun 2018 15:36:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB9E860175; Thu, 7 Jun 2018 19:36:13 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB83A60170 for ; Thu, 7 Jun 2018 19:36:11 +0000 (UTC) Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E966308124B for ; Thu, 7 Jun 2018 19:35:58 +0000 (UTC) Received: by mail-pf0-f182.google.com with SMTP id a22-v6so5391542pfo.12 for ; Thu, 07 Jun 2018 12:35:58 -0700 (PDT) Received: from centos.localdomain ([49.32.106.159]) by smtp.gmail.com with ESMTPSA id d23-v6sm86686407pfn.3.2018.06.07.12.35.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 12:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=NWlq9kN/v3NhUPJt7fcteisZJAzxvN/tiWxMbf6oNC4=; b=iWAzeXNu5V/KJw3sdx25uxxKx64aehOllKm+pC2tLz3Bkiy5l0eFlpW5jiyG/Lu4Nz T95p1YynsD45sQt8O6BuTuWDB/10e52/bkmcXl+vyajZGYolEIIfGIKSfS/QN8kB9KdW V47op0aa+fdO3tpIjh55OeVkAhPVv357M59DUn0gLgPf1qMmKKWZb+X9d0Sa6zwWx+5N fV1iA5n1w5FoVikNK6LSGu6YgWeM9Uuxe+vJP32uI5KqX343xLEoj0fbeRZgRxQpNlHs 2+dIKDbWkwFRbR4iFeFqIQiVm+XMNlVzA8+5bWY2zaCFTAa8BQtrdS6Fwm1YT1eyfcyB HLNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=NWlq9kN/v3NhUPJt7fcteisZJAzxvN/tiWxMbf6oNC4=; b=tQcasbodZrPqaqyIM9BvOsmdiW/LwvNn1OD809Qhq533/9MCF/ayAzunB/fhBixmlh iIAArx/wM9+cIvBcy7VMp7kuX1cZvRI/TQ4vJNIExrNGiPj92f1Dte4Kk+Y/oNEmvlh7 xI+Too9Xcq5UeZnXpWgwgiGy/VNYAIp6kJkogb0Hx9ofLU7x4JqAvHMyq/+BanYcZ5// hVVNHb+36XkkukmlayNYJNGYLGCflYZDt+u5VVbOVUDuA0MmFz+IPlDs68V1Ys6T28fL ez1DBkU/y7e8gI7Pmx97U3uMyqZnn8H9hAfI2Oo3IrTjrBpYdgESWwJdBpwSObv3N18+ 7kWw== X-Gm-Message-State: APt69E3cQTid8mkj7pagt4D0blhPi6+nc+VQHio0Jz7bZOQF3RQtVTzr vF6bXpMLeuegJeMGSlXhohlPgKe0 X-Google-Smtp-Source: ADUXVKIpOJk3AdPGMElQQ4N7BFas9f4Fxuqb8cJgy8o3SZSWK+IaCJ9BlIn5njqravT3ilZqFKRx4Q== X-Received: by 2002:a65:6355:: with SMTP id p21-v6mr2598494pgv.293.1528400141271; Thu, 07 Jun 2018 12:35:41 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Fri, 8 Jun 2018 01:04:43 +0530 Message-Id: <1528400083-6788-22-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1528400083-6788-1-git-send-email-skrtbhtngr@gmail.com> References: <1528400083-6788-1-git-send-email-skrtbhtngr@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 07 Jun 2018 19:35:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 07 Jun 2018 19:35:58 +0000 (UTC) for IP:'209.85.192.182' DOMAIN:'mail-pf0-f182.google.com' HELO:'mail-pf0-f182.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.301 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, SPF_PASS, T_DKIM_INVALID) 209.85.192.182 mail-pf0-f182.google.com 209.85.192.182 mail-pf0-f182.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 21/21] util: bitmap: use VIR_AUTOPTR for aggregate types 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 07 Jun 2018 19:36:18 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" By making use of the GCC's __attribute__((cleanup)) handled by VIR_AUTOPTR macro, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. --- src/util/virbitmap.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index ef18dad..37e5c0e 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -1202,15 +1202,12 @@ char * virBitmapDataFormat(const void *data, int len) { - virBitmapPtr map =3D NULL; - char *ret =3D NULL; + VIR_AUTOPTR(virBitmapPtr) map =3D NULL; =20 if (!(map =3D virBitmapNewData(data, len))) return NULL; =20 - ret =3D virBitmapFormat(map); - virBitmapFree(map); - return ret; + return virBitmapFormat(map); } =20 =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list