Skip to content

Fix GFile leak when using intermediate file on copy setting

Leak report

Direct leak of 128 byte(s) in 4 object(s) allocated from:
    #0 0x6163a2966cb9 in calloc (/usr/asan/bin/thunar+0x498cb9)
    #1 0x7943a21d50ca in g_malloc0 glib/gmem.c:133:13
    #2 0x7943a2a714ac in g_type_create_instance gobject/gtype.c:1933:17
    #3 0x7943a2a40a0d in g_object_new_internal gobject/gobject.c:2606:24
    #4 0x7943a2a3f14b in g_object_new_with_properties gobject/gobject.c:2769:14
    #5 0x7943a2a3f14b in g_object_new gobject/gobject.c:2415:12
    #6 0x7943a27ecb9f in _g_local_file_new gio/glocalfile.c:233:11
    #7 0x7943a27ecb9f in g_local_file_resolve_relative_path gio/glocalfile.c:538:11
    #8 0x7943a27ecc2b in g_local_file_get_child_for_display_name gio/glocalfile.c:574:14
    #9 0x7943a27ecd9b in g_local_file_set_display_name gio/glocalfile.c:1177:14
    #10 0x6163a2b27379 in thunar_g_file_copy thunar/thunar/thunar-gio-extensions.c:845:18
    #11 0x6163a2d251d3 in ttj_copy_file thunar/thunar/thunar-transfer-job.c:526:3
    #12 0x6163a2d23d57 in thunar_transfer_job_copy_file thunar/thunar/thunar-transfer-job.c:738:15
    #13 0x6163a2d21bbc in thunar_transfer_job_copy_node thunar/thunar/thunar-transfer-job.c:953:26
    #14 0x6163a2d1be04 in thunar_transfer_job_execute thunar/thunar/thunar-transfer-job.c:1730:11
    #15 0x7943a449c5f0 in exo_job_scheduler_job_func exo/exo/exo-job.c:310:13
    #16 0x7943a2676c6e in io_job_thread gio/gioscheduler.c:75:16
[...snip...]

Testing

  • No issues were detected with LSan, ASan, or Valgrind when testing the patch
  • I verified the copied file has the same contents as the original file
  • I verified .partial files do not persist after the copy

Merge request reports