From nobody Wed May 8 23:22:33 2024 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524226580521561.9590975991615; Fri, 20 Apr 2018 05:16:20 -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 B456930BC100; Fri, 20 Apr 2018 12:16:18 +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 447F75128F; Fri, 20 Apr 2018 12:16:18 +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 19F57181D0BD; Fri, 20 Apr 2018 12:16:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3KCElPO016674 for ; Fri, 20 Apr 2018 08:14:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4626410EE95F; Fri, 20 Apr 2018 12:14:47 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD6751102E24 for ; Fri, 20 Apr 2018 12:14:44 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Fri, 20 Apr 2018 14:14:43 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH] Fix GError memory leaks 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.42]); Fri, 20 Apr 2018 12:16:19 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: J=EF=BF=BDn Tomko --- src/gdbus.c | 8 ++++---- src/main.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gdbus.c b/src/gdbus.c index cb06813..3407116 100644 --- a/src/gdbus.c +++ b/src/gdbus.c @@ -86,7 +86,7 @@ virtDBusGDBusHandlePropertyGet(GVariant *parameters, const gchar *interface; const gchar *name; GVariant *value =3D NULL; - GError *error =3D NULL; + g_autoptr(GError) error =3D NULL; =20 g_variant_get(parameters, "(&s&s)", &interface, &name); =20 @@ -128,7 +128,7 @@ virtDBusGDBusHandlePropertySet(GVariant *parameters, const gchar *interface; const gchar *name; g_autoptr(GVariant) value =3D NULL; - GError *error =3D NULL; + g_autoptr(GError) error =3D NULL; =20 g_variant_get(parameters, "(&s&sv)", &interface, &name, &value); =20 @@ -162,7 +162,7 @@ virtDBusGDBusHandlePropertyGetAll(GDBusMethodInvocation= *invocation, { GVariant *value; g_auto(GVariantBuilder) builder; - GError *error =3D NULL; + g_autoptr(GError) error =3D NULL; =20 g_variant_builder_init(&builder, G_VARIANT_TYPE("(a{sv})")); =20 @@ -202,7 +202,7 @@ virtDBusGDBusHandleMethod(GVariant *parameters, GUnixFDList *inFDs =3D NULL; GVariant *outArgs =3D NULL; GUnixFDList *outFDs =3D NULL; - GError *error =3D NULL; + g_autoptr(GError) error =3D NULL; =20 for (gint i =3D 0; data->methods[i].name; i++) { if (g_str_equal(methodName, data->methods[i].name)) { diff --git a/src/main.c b/src/main.c index b3baf76..eb30ef8 100644 --- a/src/main.c +++ b/src/main.c @@ -52,7 +52,7 @@ virtDBusAcquired(GDBusConnection *connection, gpointer opaque) { virtDBusRegisterData *data =3D opaque; - GError *error =3D NULL; + g_autoptr(GError) error =3D NULL; =20 for (gsize i =3D 0; i < data->ndrivers; i +=3D 1) { virtDBusConnectNew(&data->connectList[i], connection, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list