From 46fa8492acdebb2c3fe4a80cd27a539d670cc687 Mon Sep 17 00:00:00 2001 From: Robert McQueen Date: Thu, 23 Nov 2017 12:07:08 +0000 Subject: session-helper: avoid theoretical GFile leaks with g_autoptr Closes: #1194 Approved by: pwithnall --- session-helper/flatpak-session-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'session-helper') diff --git a/session-helper/flatpak-session-helper.c b/session-helper/flatpak-session-helper.c index 0bf8f0b1..369f532d 100644 --- a/session-helper/flatpak-session-helper.c +++ b/session-helper/flatpak-session-helper.c @@ -477,7 +477,7 @@ file_changed (GFileMonitor *monitor, g_clear_object (&(data->monitor_real)); } - GFile *r = g_file_new_for_path (real); + g_autoptr(GFile) r = g_file_new_for_path (real); data->monitor_real = g_file_monitor_file (r, G_FILE_MONITOR_NONE, NULL, NULL); if (data->monitor_real) g_signal_connect (data->monitor_real, "changed", G_CALLBACK (file_changed), data); @@ -508,7 +508,7 @@ file_changed (GFileMonitor *monitor, static MonitorData * setup_file_monitor (const char *source) { - GFile *s = g_file_new_for_path (source); + g_autoptr(GFile) s = g_file_new_for_path (source); char *real; GFileMonitor *monitor_source, *monitor_real = NULL; MonitorData *data = NULL; @@ -522,7 +522,7 @@ setup_file_monitor (const char *source) real = realpath (source, NULL); if (real && g_strcmp0 (source, real)) { - GFile *r = g_file_new_for_path (real); + g_autoptr(GFile) r = g_file_new_for_path (real); monitor_real = g_file_monitor_file (r, G_FILE_MONITOR_NONE, NULL, NULL); } -- cgit v1.2.1