render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 5d5b2a9e3641fe1f54913284154ffb15c5a89bbb Mon Sep 17 00:00:00 2001
Message-Id: <5d5b2a9e3641fe1f54913284154ffb15c5a89bbb@dist-git>
From: Laine Stump <laine@laine.org>
Date: Wed, 13 Feb 2019 18:18:59 -0500
Subject: [PATCH] util: fix memory leak in virFirewallDInterfaceSetZone()

commit 3bba4825 added the new function virFirewallDInterfaceSetZone()
which calledsends virDBUSCallMethod a DBusMessage** for the reply
message, but doesn't use the reply, and also doesn't free it. Since
this arg is allowed to be NULL, this patch simply sets it to NULL so
we don't have to deal with it.

This patch is a part of the resolution to
https://bugzilla.redhat.com/1650320

Signed-off-by: Laine Stump <laine@laine.org>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 2c48e84b7566eab1676400d73a7934f93a7ec831)
Message-Id: <20190213231859.27018-1-laine@redhat.com>
---
 src/util/virfirewalld.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c
index 8aeb31db80..b49c895138 100644
--- a/src/util/virfirewalld.c
+++ b/src/util/virfirewalld.c
@@ -354,13 +354,12 @@ virFirewallDInterfaceSetZone(const char *iface,
                              const char *zone)
 {
     DBusConnection *sysbus = virDBusGetSystemBus();
-    DBusMessage *reply = NULL;
 
     if (!sysbus)
         return -1;
 
     return virDBusCallMethod(sysbus,
-                             &reply,
+                             NULL,
                              NULL,
                              VIR_FIREWALL_FIREWALLD_SERVICE,
                              "/org/fedoraproject/FirewallD1",
-- 
2.20.1