summaryrefslogtreecommitdiff
path: root/session-helper
diff options
context:
space:
mode:
authorRobert McQueen <rob@endlessm.com>2017-11-23 12:07:08 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-23 14:47:12 +0000
commit46fa8492acdebb2c3fe4a80cd27a539d670cc687 (patch)
treebf1cc975d174721c5904cac416c6e2e2b27d83a0 /session-helper
parentbdf0f8c554859784a7196f2688c047e212a3cefa (diff)
downloadflatpak-46fa8492acdebb2c3fe4a80cd27a539d670cc687.tar.gz
session-helper: avoid theoretical GFile leaks with g_autoptr
Closes: #1194 Approved by: pwithnall
Diffstat (limited to 'session-helper')
-rw-r--r--session-helper/flatpak-session-helper.c6
1 files changed, 3 insertions, 3 deletions
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);
}