From nobody Tue May 13 11:11:34 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 1532639098789808.9246545648214; Thu, 26 Jul 2018 14:04:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C31FC0587CE; Thu, 26 Jul 2018 21:04:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC233CE220; Thu, 26 Jul 2018 21:04: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 718D64A465; Thu, 26 Jul 2018 21:04:56 +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 w6QL4pH4024687 for ; Thu, 26 Jul 2018 17:04:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C8AA60177; Thu, 26 Jul 2018 21:04:51 +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 971B260175 for ; Thu, 26 Jul 2018 21:04:48 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) (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 00D44308624B for ; Thu, 26 Jul 2018 21:04:48 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id m1-v6so1341840plt.6 for ; Thu, 26 Jul 2018 14:04:47 -0700 (PDT) Received: from centos.localdomain ([42.106.3.93]) by smtp.gmail.com with ESMTPSA id z10-v6sm3279182pfh.83.2018.07.26.14.04.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 14:04:46 -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=T5sNNaqrQKd3eXGFMOQd3MRFOUAz25rdQV0C3BnNoRw=; b=pZUa7ib6HFdwHfTRWcRvZ13zrM1RC7KB2XB311bo8PIb5rDjhZTQYmR8pm3C7XguPD EFLlAVb/qTZgp68kdZaIqnYaV9EQxd3po+Tbp/WF7KV7gePGYOppwN37Y7HxLfiIIvYf eCLbGAGEmuvI7FPg93Ed8zIbJQFcBgiYvtQRrVtxO139IUaoYLGwu6dr8SsaLqUDF4Ff BMTkfx+YFJ+04Kwxipw9TQBd7iiI3j+r8tV89xUOFAPxyyGJ0M9Ymvri5JEo289kgUfI mjdqlAk8YkrVtA5he07Ad4gLlDS0tV8GqHUrFICyfC3r7QandLNHhUGhinTvZIO7Oxrk PEvQ== 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=T5sNNaqrQKd3eXGFMOQd3MRFOUAz25rdQV0C3BnNoRw=; b=s0nio8V6KfY+Rjr4M/0WOxtbKyah3Vqi4kBlW0l63hOjxYIlws2WmDoIbSgB3vwiGs N+LkprIk7QoY/bVnQssXmLuqA9Fr5/S2VYlDM4OyXuKY2qBhPg8oYjRgIPOsmI1EJsZ6 /cV8syD7yJ/V8YyBeHfWN8EbblOn+hZbWzF02+dgMHCTJLVySowephGycDpR3bMbIHvK 4f73jlOCt/H5i8eKHirsshVU+2/gm2qLe6BHKu8l8OnzHlJFu54I7Dz8HxX2B5spwCf9 LL58+V0ylbTeVgjKwGYqvvhRQjfPVKWS04m4mMhgMn4UtIQoUA8ujcFW9svPqsVZc7Iu zzIg== X-Gm-Message-State: AOUpUlHh3d4z8WPbRC0Ott3vZI1CNr+fmT7SzDod7N6WbOxjDQ+Es/7M tXQgqAecFQzs3/jiD7wh+3DLCsZP X-Google-Smtp-Source: AAOMgpeg+Eu2pUSV9gq5KI24jz+zuoDaQ3r73cvFXAWT+ZLdGi4XqSOEa5/tB8ISNWaD4eFA8Xuxgg== X-Received: by 2002:a17:902:7c8e:: with SMTP id y14-v6mr3416164pll.265.1532639087244; Thu, 26 Jul 2018 14:04:47 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Tue, 24 Jul 2018 21:22:06 +0530 Message-Id: <1532447562-24010-6-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1532447562-24010-1-git-send-email-skrtbhtngr@gmail.com> References: <1532447562-24010-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, 26 Jul 2018 21:04:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 26 Jul 2018 21:04:48 +0000 (UTC) for IP:'209.85.160.68' DOMAIN:'mail-pl0-f68.google.com' HELO:'mail-pl0-f68.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.37 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_PASS) 209.85.160.68 mail-pl0-f68.google.com 209.85.160.68 mail-pl0-f68.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 v2 05/41] util: buffer: 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 26 Jul 2018 21:04:57 +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 GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virbuffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index f70069e..7e66b4d 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -693,7 +693,7 @@ virBufferEscapeN(virBufferPtr buf, char *out; const char *cur; virBufferEscapePair escapeItem; - virBufferEscapePairPtr escapeList =3D NULL; + VIR_AUTOPTR(virBufferEscapePair) escapeList =3D NULL; size_t nescapeList =3D 0; va_list ap; =20 @@ -751,7 +751,6 @@ virBufferEscapeN(virBufferPtr buf, =20 cleanup: va_end(ap); - VIR_FREE(escapeList); } =20 =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list