Commit faad8f04 authored by David King's avatar David King Committed by Paolo Bacchilega

Fix _g_path_get_temp_work_dir memory leak

Found with Valgrind:

==9376== 19 bytes in 1 blocks are definitely lost in loss record 3,218
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 0x41B8B7: _g_path_get_temp_work_dir (file-utils.c:100)
==9376==    by 0x4294AD: fr_command_cfile_extract
(fr-command-cfile.c:350)
==9376==    by 0x4228B0: fr_command_extract (fr-command.c:311)
==9376==    by 0x4229FD: extract_from_archive (fr-command.c:1857)
==9376==    by 0x422C3F: _fr_command_extract (fr-command.c:2131)
==9376==    by 0x4236A3: _fr_command_extract_to_local
(fr-command.c:2334)
==9376==    by 0x43E9B7: _fr_window_archive_extract_from_edata
(fr-window.c:6395)
==9376==    by 0x446311: _fr_window_ask_overwrite_dialog
(fr-window.c:6570)
==9376==    by 0x71FC30A: g_cclosure_marshal_VOID__ENUMv
(gmarshal.c:1496)
==9376==    by 0x71FA0C3: _g_closure_invoke_va (gclosure.c:864)
==9376==    by 0x72142A0: g_signal_emit_valist (gsignal.c:3246)
==9376==    by 0x72148F1: g_signal_emit (gsignal.c:3393)
==9376==    by 0x71FA0C3: _g_closure_invoke_va (gclosure.c:864)
==9376==    by 0x72142A0: g_signal_emit_valist (gsignal.c:3246)
==9376==    by 0x72148F1: g_signal_emit (gsignal.c:3393)
==9376==    by 0x516918C: gtk_button_do_release (gtkbutton.c:1899)
==9376==    by 0x51691F7: gtk_real_button_released (gtkbutton.c:2017)

https://bugzilla.gnome.org/show_bug.cgi?id=752476
parent d496cba8
......@@ -109,6 +109,7 @@ _g_path_get_temp_work_dir (const char *parent_folder)
template = g_strconcat (best_folder, "/.fr-XXXXXX", NULL);
result = mkdtemp (template);
g_free (best_folder);
if ((result == NULL) || (*result == '\0')) {
g_free (template);
......
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