[PATCH libgpiod 3/3] dbus: client: monitor: free the line list at exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

Free the list of line proxies stored for the duration of the program at
exit to fix a memory leak.

Note: these objects need to be kept alive for D-Bus events to work.

Fixes: a5ab76da1e0a ("dbus: add the D-Bus daemon, command-line client and tests")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
 dbus/client/monitor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dbus/client/monitor.c b/dbus/client/monitor.c
index 3bd25b8..df7eb51 100644
--- a/dbus/client/monitor.c
+++ b/dbus/client/monitor.c
@@ -185,6 +185,7 @@ int gpiocli_monitor_main(int argc, char **argv)
 
 	g_main_loop_run(loop);
 
+	g_list_free_full(data.lines, g_object_unref);
 	g_bus_unwatch_name(watch_id);
 
 	return EXIT_SUCCESS;

-- 
2.43.0





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux