From nobody Tue May 13 22:22:12 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 1528400122870304.4724075616043; Thu, 7 Jun 2018 12:35:22 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C48C3308214E; Thu, 7 Jun 2018 19:35:20 +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 8095F600D1; Thu, 7 Jun 2018 19:35:20 +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 249B1180121C; Thu, 7 Jun 2018 19:35:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w57JZH2I018921 for ; Thu, 7 Jun 2018 15:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id DCD4D16E28; Thu, 7 Jun 2018 19:35:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6C712B4AB for ; Thu, 7 Jun 2018 19:35:12 +0000 (UTC) Received: from mail-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) (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 765C7308FB99 for ; Thu, 7 Jun 2018 19:35:01 +0000 (UTC) Received: by mail-pg0-f41.google.com with SMTP id l2-v6so5225123pgc.7 for ; Thu, 07 Jun 2018 12:35:01 -0700 (PDT) Received: from centos.localdomain ([49.32.106.159]) by smtp.gmail.com with ESMTPSA id d23-v6sm86686407pfn.3.2018.06.07.12.34.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 12:35:00 -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=p1JR9512Tj92DOqkjswnTBBf9J+pnVip6vEwYTbKaro=; b=CjXOPQI2KvPQxX3nRJt6DuUXJVZ/Yoq+suNqih2Y9MK7JnqTzpfIkEjFgoNUfOS0N9 zLo1FI7ZnRD/V9oL6TZVe4qb4gYoQ6CT/J/5jsvrYNDqAelDRD59m/FuoOZQArjzZLTF Xv9bmeMBkdc6SwSKQV9DN5wjzz7MsueJXukI0BH9g29WoxN5hFgiCOLdABF0mpwO9TbL JPKF0Ygx80v8Ap0ZeHhZhJTLpnn0dmPf5Lk05IQMsHeTJWTFMSn05oaFADcQwuVYZp1K xhPVxNWgMfDCOs9cnDPBaUO61AwAU1+sGlaLxveLqZaN0g6kN757ag6g3+9m5xx27ikx KZOA== 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=p1JR9512Tj92DOqkjswnTBBf9J+pnVip6vEwYTbKaro=; b=ocEWgOLIqK48IrMy3NsfXPs0RlfxvwOsf65lRCnU59w32XG449tXo6Fi0K+ngVbcOV +fYEuoHLZSl2/Ot/KZf2lfDalITLDwCFdeA1abCml2VhJHU2lzhDrg7L+kYt64jy2yRA JhTt5EC5dH3hucVsxyKiUwLHWXwasZIaaco8MiY2b0Tyvs4Rxw/ml0NkxpJQfHLJODB+ lZGR7MJUN9mHuaODkbU9+JY8OztIqpcgniiCBjboMfnE5tbvTmqe96JovREo/DGGympp TGih2ydy2W0KSLGyarnitXvp6NVy768ebIQ2eJKvE4LrUJ0+psGHYvnRMPj/UVCtnZ9d yLEQ== X-Gm-Message-State: APt69E3W1VlT6Q66TdGxvwJdbb8HBo7z2BSLmS1LsMVHRGAsquqx2xHO GlGE/aTEbfbC2wn9HtHLx1sk18iI X-Google-Smtp-Source: ADUXVKKztMRrGXCOAe9FTxzz0VbE/rzEebExeFAdxNvQ2V3oSNW4XTNKWXmd3uPsYQV+bdgdjx5TIA== X-Received: by 2002:a63:af50:: with SMTP id s16-v6mr2675905pgo.263.1528400100689; Thu, 07 Jun 2018 12:35:00 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Fri, 8 Jun 2018 01:04:26 +0530 Message-Id: <1528400083-6788-5-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.43]); Thu, 07 Jun 2018 19:35:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 07 Jun 2018 19:35:01 +0000 (UTC) for IP:'74.125.83.41' DOMAIN:'mail-pg0-f41.google.com' HELO:'mail-pg0-f41.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) 74.125.83.41 mail-pg0-f41.google.com 74.125.83.41 mail-pg0-f41.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 04/21] util: audit: use VIR_AUTOFREE instead of VIR_FREE for scalar 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 07 Jun 2018 19:35:21 +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_AUTOFREE macro, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. --- src/util/viraudit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/viraudit.c b/src/util/viraudit.c index 0085dc3..a49d458 100644 --- a/src/util/viraudit.c +++ b/src/util/viraudit.c @@ -97,7 +97,7 @@ void virAuditSend(virLogSourcePtr source, virAuditRecordType type ATTRIBUTE_UNUSED, bool success, const char *fmt, ...) { - char *str =3D NULL; + VIR_AUTOFREE(char *) str =3D NULL; va_list args; =20 /* Duplicate later checks, to short circuit & avoid printf overhead @@ -144,7 +144,6 @@ void virAuditSend(virLogSourcePtr source, } } #endif - VIR_FREE(str); } =20 void virAuditClose(void) --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list