From nobody Sun Feb 8 18:30:04 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 153217508015396.91683347333799; Sat, 21 Jul 2018 05:11:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8667A307C701; Sat, 21 Jul 2018 12:11:12 +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 4992A26E60; Sat, 21 Jul 2018 12:11:11 +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 EC0271841C5D; Sat, 21 Jul 2018 12:11:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6LC8JxR016414 for ; Sat, 21 Jul 2018 08:08:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 63F71CC105; Sat, 21 Jul 2018 12:08:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5CFCFC4A64 for ; Sat, 21 Jul 2018 12:08:19 +0000 (UTC) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 88BAA30820DD for ; Sat, 21 Jul 2018 12:08:08 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id z8-v6so8965847pgu.8 for ; Sat, 21 Jul 2018 05:08:08 -0700 (PDT) Received: from centos.localdomain ([42.106.1.69]) by smtp.gmail.com with ESMTPSA id s16-v6sm5861694pfm.114.2018.07.21.05.08.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jul 2018 05:08:07 -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=O/XIIIhR7SR2c+5o76IQ9rVKE8OhI2cWC2IdCpQcQ4I=; b=NXLbnf4184fI5CKHw5YzC9uF5S4nl+F0lPhjjVMSz6HcHerW+jRaLqwiTg0trTcdU1 vcsGlxXQVeIRpMnvNQa3XRsWjxfvHtSpt7kbvDDvWGk0iBwT4JxqXgZlysrLdybHB+Zr RJNZrsDH27BxjXJD9Q01MLkcdCTPGLnvdOETuLmASWhJXo+bNzDx23Sac+zLV1Kr6yAq 15XoV9RI5mu5zZCaUb3oCm+nwtNZLPoVLHqfrc35W/Cnqcy7kkQTaF7IC/pizSJlt3Po UPXVPyiiXV9lrQcsfetXqntdI5j6jZI0OtUHfDZMicTnT+ViAWIGjMUwtIEz7ObyrqcK uWFQ== 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=O/XIIIhR7SR2c+5o76IQ9rVKE8OhI2cWC2IdCpQcQ4I=; b=Nr2DYVSXXOOzRDR1vgQp8CaiUIiGxCPnjzCeOK77AnLvwbFpRfUXR6msBeRavnkyym l8ZrDoUy2jIluObtqk3y1hgGq33DQjGUdJClndIRvLrDNtIH9YS+CHcg5I1dcEh4xdut +k1PlYLcJGZgVCK1baAmwbGAzbfUIXlNPnGkdU1aONROqu3/0c79qC/AUdfE6qOEn9Vu Kr/r8rMK0JzGsoWcOGZOlNxpugoLqoFzsvferSVP0N6EUc6X11EbSLszNmTW3xcMO5r0 +WuN6/KnDpywQ5YrlJtLboFIsIygEb0nD2fxHKmrT7klAD/Ikl68ApYEqftsjAccUYwJ RWLg== X-Gm-Message-State: AOUpUlHeIgzFguc7+eIdAwj15hUwu8w6ODU0roUSR4miydNh9mSqS7NS CCp/uM4ez3ZBeIWJioVxr3QFXmxV X-Google-Smtp-Source: AAOMgpdTHAPv9DlHJ+87cQLRNBmjG/Xz1kN/WtyhHqr+whx/szK0srdb8gl+o0yjhRHwgFYhq3fxSw== X-Received: by 2002:a62:a3d1:: with SMTP id q78-v6mr5806109pfl.5.1532174887873; Sat, 21 Jul 2018 05:08:07 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Sat, 21 Jul 2018 17:36:50 +0530 Message-Id: <1532174832-21644-19-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1532174832-21644-1-git-send-email-skrtbhtngr@gmail.com> References: <1532174832-21644-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.47]); Sat, 21 Jul 2018 12:08:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 21 Jul 2018 12:08:08 +0000 (UTC) for IP:'209.85.215.177' DOMAIN:'mail-pg1-f177.google.com' HELO:'mail-pg1-f177.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) 209.85.215.177 mail-pg1-f177.google.com 209.85.215.177 mail-pg1-f177.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 18/40] util: hook: 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 21 Jul 2018 12:11:19 +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 Reviewed-by: Erik Skultety --- src/util/virhook.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/virhook.c b/src/util/virhook.c index 51f0eb5..de80947 100644 --- a/src/util/virhook.c +++ b/src/util/virhook.c @@ -230,7 +230,7 @@ virHookCall(int driver, { int ret; VIR_AUTOFREE(char *) path =3D NULL; - virCommandPtr cmd; + VIR_AUTOPTR(virCommand) cmd =3D NULL; const char *drvstr; const char *opstr; const char *subopstr; @@ -312,7 +312,5 @@ virHookCall(int driver, virGetLastErrorMessage()); } =20 - virCommandFree(cmd); - return ret; } --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list