Commit 2e5de0b6 authored by David King's avatar David King Committed by Paolo Bacchilega

Fix _g_file_is_temp_work_dir memory leak

Found with Valgrind:

==9376== 47 bytes in 1 blocks are definitely lost in loss record 8,821
of 17,916
==9376==    at 0x4C2BC50: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd6
4-linux.so)
==9376==    by 0x748B689: g_malloc (gmem.c:97)
==9376==    by 0x74A425E: g_strdup (gstrfuncs.c:356)
==9376==    by 0x41B94E: _g_file_is_temp_work_dir (file-utils.c:575)
==9376==    by 0x41BA2B: _g_file_is_temp_dir (file-utils.c:266)
==9376==    by 0x43C271: fr_window_add_to_recent_list (fr-window.c:2670)
==9376==    by 0x4457E0: _archive_operation_completed (fr-window.c:3019)
==9376==    by 0x4480BB: archive_list_ready_cb (fr-window.c:5881)
==9376==    by 0x6ED9ACC: g_simple_async_result_complete
(gsimpleasyncresult.c:801)
==9376==    by 0x6ED9B3B: complete_in_idle_cb (gsimpleasyncresult.c:813)
==9376==    by 0x7485C89: g_main_dispatch (gmain.c:3122)
==9376==    by 0x7485C89: g_main_context_dispatch (gmain.c:3737)
==9376==    by 0x7486007: g_main_context_iterate.isra.29 (gmain.c:3808)
==9376==    by 0x74860AB: g_main_context_iteration (gmain.c:3869)
==9376==    by 0x6F0F5BB: g_application_run (gapplication.c:2311)
==9376==    by 0x414FE5: main (main.c:38)

https://bugzilla.gnome.org/show_bug.cgi?id=752476
parent faad8f04
......@@ -574,8 +574,10 @@ _g_file_is_temp_work_dir (GFile *file)
int i;
path = g_file_get_path (file);
if (path[0] != '/')
if (path[0] != '/') {
g_free (path);
return FALSE;
}
for (i = 0; try_folder[i] != NULL; i++) {
const char *folder;
......@@ -589,6 +591,8 @@ _g_file_is_temp_work_dir (GFile *file)
}
}
g_free (path);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment