[libvirt] [dbus PATCH 1/4] gdbus: fix memory and FD leak in virtDBusGDBusHandleMethod

Pavel Hrdina phrdina at redhat.com
Thu May 10 11:01:29 UTC 2018


Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 src/gdbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gdbus.c b/src/gdbus.c
index 3407116..2cce6ff 100644
--- a/src/gdbus.c
+++ b/src/gdbus.c
@@ -1,5 +1,6 @@
 #include "gdbus.h"
 
+#include <gio/gunixfdlist.h>
 #include <glib/gprintf.h>
 
 struct _virtDBusGDBusMethodData {
@@ -201,7 +202,7 @@ virtDBusGDBusHandleMethod(GVariant *parameters,
     GDBusMessage *msg = g_dbus_method_invocation_get_message(invocation);
     GUnixFDList *inFDs = NULL;
     GVariant *outArgs = NULL;
-    GUnixFDList *outFDs = NULL;
+    g_autoptr(GUnixFDList) outFDs = NULL;
     g_autoptr(GError) error = NULL;
 
     for (gint i = 0; data->methods[i].name; i++) {
-- 
2.17.0




More information about the libvir-list mailing list