summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2018-03-20 21:58:20 +0800
committerPhilip Withnall <withnall@endlessm.com>2018-03-26 10:58:37 +0100
commit5ef27d0e2672b606419a1253e2f7a86904412cd0 (patch)
tree2567f951393cbb4eb29bbbda77a0512977d3d75b
parentfe939d2b704c0b7ea3f0c429528d29441f780fb8 (diff)
downloadglib-5ef27d0e2672b606419a1253e2f7a86904412cd0.tar.gz
gpollfilemonitor: Fix use-after-free caused by leaking GSource
https://bugzilla.gnome.org/show_bug.cgi?id=794528
-rw-r--r--gio/gpollfilemonitor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gio/gpollfilemonitor.c b/gio/gpollfilemonitor.c
index 411e00393..bd3d78a02 100644
--- a/gio/gpollfilemonitor.c
+++ b/gio/gpollfilemonitor.c
@@ -50,7 +50,9 @@ g_poll_file_monitor_finalize (GObject* object)
poll_monitor = G_POLL_FILE_MONITOR (object);
+ g_poll_file_monitor_cancel (G_FILE_MONITOR (poll_monitor));
g_object_unref (poll_monitor->file);
+ g_clear_object (&poll_monitor->last_info);
G_OBJECT_CLASS (g_poll_file_monitor_parent_class)->finalize (object);
}