From nobody Tue May 13 11:15:24 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 1532639140617603.4401988589924; Thu, 26 Jul 2018 14:05:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3EA513001FC7; Thu, 26 Jul 2018 21:05:23 +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 02D8561294; Thu, 26 Jul 2018 21:05:22 +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 97B363F8F1; Thu, 26 Jul 2018 21:05:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6QL5JWk024838 for ; Thu, 26 Jul 2018 17:05:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 02FFD1001F4E; Thu, 26 Jul 2018 21:05:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 984861001938 for ; Thu, 26 Jul 2018 21:05:14 +0000 (UTC) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 DA7D830832E4 for ; Thu, 26 Jul 2018 21:05:13 +0000 (UTC) Received: by mail-pg1-f170.google.com with SMTP id v13-v6so1877914pgr.10 for ; Thu, 26 Jul 2018 14:05:13 -0700 (PDT) Received: from centos.localdomain ([42.106.3.93]) by smtp.gmail.com with ESMTPSA id z10-v6sm3279182pfh.83.2018.07.26.14.05.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 14:05:12 -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=05juxiprNj12mWbOZzU724z0tRd0KMiHwtjXE7FGM70=; b=kyQ72U/o7t4OmYZedjEWNIgHBvLHmoh1eaWike1xEwPNVSOMaZ4n7kUxhvgUsmYGli 4aJHyoSjonFPV5vjM+AWiUjJok+saEqkly0Ra3xOga9S1/RPljNQ7dNZqRfVu/ZnHaQf Hd8OUPrbi4nUWODiyRD4vPZE6RsC4N6If2G+TSBgvJyTDj5mzSUUgLop00jNyLkh7BHo AkRLe4IUFqWD1zqTjdRhZXO+twcXBTcvPYffOfJUkFMN5TmA0lQfBOdG9tQYIn4E2LLp OAtJtDsZYyE9Hi9p9UOt+B4xwvg8k4Ffa2k/rKXEeQWiq8puKnMVUxZ1gfAEh+sw37tn 1eYg== 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=05juxiprNj12mWbOZzU724z0tRd0KMiHwtjXE7FGM70=; b=I4I1azY/WCLRjAtFUYmeJyxVQcBP9FA+efjv1ArLjr8roReb9hmVNQPyELf0P/G5OP n9pAoGPWfXaidhzaC7a9W5BG6RidgPCoOxLz/SM3oCWHcw54kXO08hcls4BFBXIm0wrq IjJIMVaEediLV/6vHi+Ic8gwhc6m4iUzBvi5uSV/FrPCroqkrDipoFz62vz90Pnne7n3 kYJCIFJCbzqKq/bTLY06Fut7Ame4pXP0ynNEXQKof+1fQXEl62D0u83abgWWQOf3PZhG VNNy1aFLrCsIKGHWbU1LwcuqEO/eEA6W+Lst6WHzMOJ6FU9hzKepNzye/QohQgbrv4wL SN+A== X-Gm-Message-State: AOUpUlF6akk/b5J2mWRGm1J6lbpYybifY7pFGBCFSse4/9ci66BQ14Au gV66VftX8NE0SSnksjL4sCo0rwii X-Google-Smtp-Source: AAOMgpduioXeefDgkWhetbw+HyCkUZehe8WplnEdKc+x2vbOagT8akR7iTz78i4Vbnj6j3/TAWiUzg== X-Received: by 2002:a62:1314:: with SMTP id b20-v6mr3708664pfj.230.1532639113128; Thu, 26 Jul 2018 14:05:13 -0700 (PDT) From: Sukrit Bhatnagar To: libvir-list@redhat.com Date: Tue, 24 Jul 2018 21:22:19 +0530 Message-Id: <1532447562-24010-19-git-send-email-skrtbhtngr@gmail.com> In-Reply-To: <1532447562-24010-1-git-send-email-skrtbhtngr@gmail.com> References: <1532447562-24010-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.44]); Thu, 26 Jul 2018 21:05:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 26 Jul 2018 21:05:13 +0000 (UTC) for IP:'209.85.215.170' DOMAIN:'mail-pg1-f170.google.com' HELO:'mail-pg1-f170.google.com' FROM:'skrtbhtngr@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.37 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_PASS) 209.85.215.170 mail-pg1-f170.google.com 209.85.215.170 mail-pg1-f170.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 18/41] 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 26 Jul 2018 21:05:23 +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 4673655..993f06d 100644 --- a/src/util/virhook.c +++ b/src/util/virhook.c @@ -232,7 +232,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; @@ -314,7 +314,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