From nobody Sun Feb 8 14:11:23 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 1530481538843136.44281196107204; Sun, 1 Jul 2018 14:45:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D23EA3082A49; Sun, 1 Jul 2018 21:45:37 +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 9100F5C6C1; Sun, 1 Jul 2018 21:45:37 +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 3488F24601; Sun, 1 Jul 2018 21:45:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w61LjYEs009667 for ; Sun, 1 Jul 2018 17:45:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 06795308332C; Sun, 1 Jul 2018 21:45:34 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2E9D30C43AF for ; Sun, 1 Jul 2018 21:45:29 +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 2E41D80F7B for ; Sun, 1 Jul 2018 21:45:19 +0000 (UTC) Received: by mail-pg0-f41.google.com with SMTP id n2-v6so6207885pgq.6 for ; Sun, 01 Jul 2018 14:45:19 -0700 (PDT) Received: from centos.localdomain ([157.37.164.55]) by smtp.gmail.com with ESMTPSA id v68-v6sm15006933pfv.143.2018.07.01.14.45.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 14:45:17 -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=4qHGja3bo5OuimEyhJ5N9gK7bmu+Wargau/y77zFPh4=; b=gG5pri0Jg/rrw50dnVUwKv+itXTaRGQZV4kDTy3tI5cK42btqPo9VhVq3fOMhlELzC 84J5VdFemUypHrLn8345W9bmha5/zVpb5xWYKAage/apf3UFsWF8vQSOwVk4I31MvtFK D54F4TloJBwu56dgoi4ohTtZQUnByzpS6qS5LnF2w/PIN2KOC+VIjDpTZejxj84UCxmy 7xyI+2t+dU8leu0M2tDTUpcuyXZ7EPCJaZAuCYu8IzWFaWDfv0WjaoQ/np0kcs+GXupG uaBku4VVzPLJlDGG3OwbUIiYgzHTEMdBfG+DQ2UeCWK045OMX3aKXnSF4mZKCFF7AQok rXTQ== 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=4qHGja3bo5OuimEyhJ5N9gK7bmu+Wargau/y77zFPh4=; b=NYqR3FwR08wqKU8E7AslmPtrarpE5vKbCf3yvB1f2V8koM2ZvjI6PTZly5qsjdVZRq 0joWhKEFiY6991nycbFSjq4rEzadLDAY/LC7QkU0bfpq+qEYbjwNKYcr7s8ORVW7c+Qk SrkGoaXz1M4qd2eJcDzGfmaGDB9rfS3B63og6OlgQEZvFg0kU7Poa9QwYjiMvdgBLIc1 Sh2KDwSeSeoogGl0H6MCzVDW+J3iw2D+OBiai58XZjueMuLrxj+QQwcXsZnDzdBgnTFn 7ncHWa+ebUs4FzUlnwdPnlhl2pPn4hVsqEvE8RJncYXExxIVPr9m7zMiBcbsyVYgAQLh 4c4A== X-Gm-Message-State: APt69E30/nE+jZQJDTJVh2wrYaUVBfKKg4/wzT0UMyhqqD39od1zO0/5 mC4wsaqaQ4Wiu0otFY/S2jmN61M6 X-Google-Smtp-Source: AAOMgpeOybXArxppVPuuBPQN3YqoXSI7iZp0l1ACLLnd5nV4j0fi/EPszUAhZond10HXzKHT53nzUA== X-Received: by 2002:a62:d09:: with SMTP id v9-v6mr22521828pfi.163.1530481518407; Sun, 01 Jul 2018 14:45:18 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sat, 30 Jun 2018 14:30:35 +0530 Message-Id: <1530349239-22049-32-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1530349239-22049-1-git-send-email-skrtbhtngr@gmail.com> References: <1530349239-22049-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.27]); Sun, 01 Jul 2018 21:45:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 01 Jul 2018 21:45:19 +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.786 * (DATE_IN_PAST_24_48, 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.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 31/35] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Sun, 01 Jul 2018 21:45:38 +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_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- 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