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

Pavel Hrdina posted 4 patches 7 years ago
[libvirt] [dbus PATCH 1/4] gdbus: fix memory and FD leak in virtDBusGDBusHandleMethod
Posted by Pavel Hrdina 7 years ago
Signed-off-by: Pavel Hrdina <phrdina@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list