From 612ba2d28445bece2595eaf38c1f020da04a0551 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 11 Oct 2008 23:10:45 -0300 Subject: [PATCH] Fixed the use of a dangling reference When unreferencing the info object, the name attribute would be released, resulting in a bug when trying to copy it right after that. So, we unreference the info object in the end of the loop now. --- backend/gio/gio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/gio/gio.c b/backend/gio/gio.c index 095345b..2f35a00 100644 --- a/backend/gio/gio.c +++ b/backend/gio/gio.c @@ -99,7 +99,6 @@ gio_enumerate_entries (AtomCtx *ctx, char ***reqs, AtomEntry ***entries, { name = g_file_info_get_name (info); filename = g_build_filename (root, name, NULL); - g_object_unref (info); file = g_file_new_for_path (filename); entry = gio_file_to_atom (ctx, file); if (entry) @@ -113,6 +112,7 @@ gio_enumerate_entries (AtomCtx *ctx, char ***reqs, AtomEntry ***entries, } g_object_unref (file); g_free (filename); + g_object_unref (info); } g_object_unref (enumerator); g_object_unref (dir); -- 2.20.1