From nobody Mon Feb 9 15:08:29 2026 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 1533714275253946.7356345965004; Wed, 8 Aug 2018 00:44:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49F5E307D871; Wed, 8 Aug 2018 07:44:33 +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 170942010D0C; Wed, 8 Aug 2018 07:44:33 +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 BC92A1800B74; Wed, 8 Aug 2018 07:44:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w787iUtt006069 for ; Wed, 8 Aug 2018 03:44:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id E83CE1ACAF; Wed, 8 Aug 2018 07:44:30 +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 D563B18429 for ; Wed, 8 Aug 2018 07:44:24 +0000 (UTC) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) (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 E998230B8F84 for ; Wed, 8 Aug 2018 07:44:23 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id u11-v6so662965plq.5 for ; Wed, 08 Aug 2018 00:44:23 -0700 (PDT) Received: from centos.localdomain ([42.106.0.165]) by smtp.gmail.com with ESMTPSA id 9-v6sm9617719pfv.53.2018.08.08.00.44.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 00:44:22 -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=yFTFE2mz9b7IuFmRQATimspge1dqcjZlUeUJBSrPv8I=; b=ixQt0/5hhzfqG7OhYB4AInSfCO70+y5QRtT1ZlIJgoIBKh81eWV1Idfr4RjVxsoBHZ +KiO1zzxN922nJT2hVB3obkwltdlJje9ujj73mkXug74FlIrsBQC6Vr2Opy5dx2obArz CXrpOiZfPdHsLf/+Jp4063M84kLOzbV1TqhqQhMXkVy2tsCmSBaUgWPwAXGwKuX/7lbp uHu1EpqR3HL/ld8xgGSFr1Qjq00tfeogy9oE7J4EfVR84sshmVVBOod7tQoTRahRPPlx 29Efo6jh5DhR8qeIX4up3hn2XMDN7xM6275z1/+B5NxY7ltadT64y/oOjLWy5NM0f6XL 6ghQ== 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=yFTFE2mz9b7IuFmRQATimspge1dqcjZlUeUJBSrPv8I=; b=Rtz5AUaWcDpNcem37/3a4C+CU7wrAUF2ivk6JiO7zE0rcAeK+/d5UE4cwtCC4hRs1Z HAcFrMZY7PZlpPDvWUYt/a2RFkr4LTMRwVWISWDn41G8v15exDl5NPLHE+zY1dF1Ljnc 6AVmlrTLGZ+a/Nhdjqc8vK0b5/sOh2rImlyNrVhTbsgPey7TdLr2UlNKyRVCBiGlb5/h wI8QcxMI143V0mY6nv158tqPKHG82z71bY7fC5Mca9As1+dcl9sIBfZS71J6cG4+jqFO /1N4w10Nzf77udjzUqORv40vWpU0bckO8nQzEgRw+Atc+RXBqMuBwqwChtq2c9Y1O6cJ dwNg== X-Gm-Message-State: AOUpUlEP/QBM7Y/O7O9mUu87URaEtpE9H02SGSJnoiz24TSFyA9frmCL zYJnCGXt6Kkiy2teNSWZaKgAXvnn X-Google-Smtp-Source: AA+uWPy7nA6nIudRKijEXVKb4lXlkEF5gqYOjLKH0dv8rjdFAzmJG/v2CRvwJcgIDp8wSBcBIHbKow== X-Received: by 2002:a17:902:6684:: with SMTP id e4-v6mr1509585plk.35.1533714263222; Wed, 08 Aug 2018 00:44:23 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Mon, 6 Aug 2018 02:14:02 +0530 Message-Id: <1533501842-24503-36-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1533501842-24503-1-git-send-email-skrtbhtngr@gmail.com> References: <1533501842-24503-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]); Wed, 08 Aug 2018 07:44:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 08 Aug 2018 07:44:24 +0000 (UTC) for IP:'209.85.160.67' DOMAIN:'mail-pl0-f67.google.com' HELO:'mail-pl0-f67.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.13 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.160.67 mail-pl0-f67.google.com 209.85.160.67 mail-pl0-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 35/35] util: qemu: 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.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 08 Aug 2018 07:44:34 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 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/virqemu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/virqemu.c b/src/util/virqemu.c index 4089b8e..bb88f49 100644 --- a/src/util/virqemu.c +++ b/src/util/virqemu.c @@ -56,7 +56,7 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key, { ssize_t pos =3D -1; ssize_t end; - virBitmapPtr bitmap =3D NULL; + VIR_AUTOPTR(virBitmap) bitmap =3D NULL; =20 if (virJSONValueGetArrayAsBitmap(array, &bitmap) < 0) return -1; @@ -73,8 +73,6 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key, } } =20 - virBitmapFree(bitmap); - return 0; } =20 @@ -282,6 +280,7 @@ virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr sr= cdef) cleanup: virBufferFreeAndReset(&buf); return ret; + } =20 =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list