From nobody Wed May 14 01:26:40 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 1528124316728294.0318095936026; Mon, 4 Jun 2018 07:58:36 -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 DAF3430C94C6; Mon, 4 Jun 2018 14:58:34 +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 A21E89B004; Mon, 4 Jun 2018 14:58:34 +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 4C5604CA81; Mon, 4 Jun 2018 14:58:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w54EagFH008082 for ; Mon, 4 Jun 2018 10:36:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6F3A72010DA1; Mon, 4 Jun 2018 14:36:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 653152010D9F for ; Mon, 4 Jun 2018 14:36:42 +0000 (UTC) Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.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 7CC9FB8904 for ; Mon, 4 Jun 2018 14:36:31 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id a13-v6so14531815pgu.4 for ; Mon, 04 Jun 2018 07:36:31 -0700 (PDT) Received: from centos.localdomain ([42.106.2.208]) by smtp.gmail.com with ESMTPSA id f63-v6sm23448806pfe.143.2018.06.04.07.36.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 07:36:30 -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=+7RgcvDSujfvXMnHXCGvnKxHhs5ns48+imawVJGWVXw=; b=QH+aRGb2BUAyfLmqySQE3a07+2zUDWHCsnxFwvIGzU5aSjvUFirJHv+VZjxp2bWORz +seTkox5eRqhDs1JudoUK5mbtfQPwokbHeHqrA8x2jbdudb+YIn/ZkF9PKgx582DT8zc 3k25fFygb6AJpkrc4zWHgUtBp1Go68ONYkCeVuYLdkDYlLHz4ihaTDPRLOxf8kpc2RYK jYluhe2kbIWrHsFFZ0NqEHYkZ37Sr4ISeogGo0dhyqgjGhqjFf0hShVEL0+0IoEJGUG8 Xnonro7aKPi3ZZgG8qxXaM/O6oUgeEx+EbCMmfZkQcGwWn40n1gZMmk18UISFcjWPnFo y4oA== 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=+7RgcvDSujfvXMnHXCGvnKxHhs5ns48+imawVJGWVXw=; b=pDDo1tdy3AGrkNiSh3YQTTrl3AH4z9WGyCZ8uenY8lHOQc+xdRJx848SAGJrkfr5+f o3c8zbcRHsAat1o0x9rGQbn0ea3o5rYtsOlWOeWeS4NnBvuYfIMy9wIkm/H3wXRpSjzs ZyM6YEJpiLY05S2Wtz00dyp3A9qcQdMA2H9/a8rDVVZ+9/82hU4uSqs/4OcNu1p+iFSo oSnWBNAFi1iL4Hdp8+Wz8JIQCoRjZfI8j/Aa2z8XRSnbDbAepf4IewhUQnAlPt+70WNd 4IhFTcancciCfLSqE4Z1ZAr4VtxHVsIX56yVXdoKAbSX1lU+TRb4oM0P/S6lnaYymVXk PKag== X-Gm-Message-State: APt69E0em6enmdXfKllju+sMr4//onhxAKLy8jGUpLr4sgW90LQPggtQ mVNxK/hxxo8b5UdR3pQIUD+/NYx+ X-Google-Smtp-Source: ADUXVKKjrQRBW16gcmhq6VzlCxgkLyTem1xd6Eafk2+GX0V46T7zuy6HxkxgAUXo39/aGgOG3YlOmQ== X-Received: by 2002:a62:8d03:: with SMTP id z3-v6mr8082821pfd.112.1528122990669; Mon, 04 Jun 2018 07:36:30 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sun, 3 Jun 2018 13:42:03 +0530 Message-Id: <1528013536-22196-6-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1528013536-22196-1-git-send-email-skrtbhtngr@gmail.com> References: <1528013536-22196-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.25]); Mon, 04 Jun 2018 14:36:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 04 Jun 2018 14:36:31 +0000 (UTC) for IP:'74.125.83.67' DOMAIN:'mail-pg0-f67.google.com' HELO:'mail-pg0-f67.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.766 * (DATE_IN_PAST_24_48, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 74.125.83.67 mail-pg0-f67.google.com 74.125.83.67 mail-pg0-f67.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 05/18] use VIR_AUTOFREE in src/util/iohelper.c 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.44]); Mon, 04 Jun 2018 14:58:35 +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" Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/iohelper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index bb8a8dd..f7794dc 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -46,7 +46,7 @@ static int runIO(const char *path, int fd, int oflags) { - void *base =3D NULL; /* Location to be freed */ + VIR_AUTOFREE(void *) base =3D NULL; /* Location to be freed */ char *buf =3D NULL; /* Aligned location within base */ size_t buflen =3D 1024*1024; intptr_t alignMask =3D 64*1024 - 1; @@ -174,8 +174,6 @@ runIO(const char *path, int fd, int oflags) virReportSystemError(errno, _("Unable to close %s"), path); ret =3D -1; } - - VIR_FREE(base); return ret; } =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list