Skip to content

Commit

Permalink
dt_ctl_get_display_profile_colord_callback(): free icc buffer we just…
Browse files Browse the repository at this point in the history
… got if profile has not changed

Fixes following LeakSanitizer-detected leak:
Direct leak of 516129 byte(s) in 1 object(s) allocated from:
    #0 0x7f8c5f2bc74f in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5474f)
    #1 0x7f8c5c8967cb in g_file_get_contents (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x367cb)
    #2 0x7f8c5eeb809a in dt_ctl_get_display_profile_colord_callback /home/lebedevri/darktable/src/control/control.c:125
    #3 0x7f8c5ce3cdf6 in g_simple_async_result_complete (/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0+0x74df6)
    #4 0x7f8c5ce3ce58 (/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0+0x74e58)
    #5 0x7f8c5c8a9b4c in g_main_context_dispatch (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x49b4c)
    #6 0x7f8c5c8a9f1f (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x49f1f)
    #7 0x7f8c5c8aa241 in g_main_loop_run (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4a241)
    #8 0x7f8c5e64bbf4 in gtk_main (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x1ebbf4)
    #9 0x7f8c5efe5384 in dt_gui_gtk_run /home/lebedevri/darktable/src/gui/gtk.c:964
    #10 0x400cf3 in main /home/lebedevri/darktable/src/main.c:25
    #11 0x7f8c57691b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    #12 0x400bd8 (/usr/local/bin/darktable+0x400bd8)
  • Loading branch information
LebedevRI committed May 23, 2015
1 parent 5cf182b commit e9f50c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/control/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ static void dt_ctl_get_display_profile_colord_callback(GObject *source, GAsyncRe
dt_print(DT_DEBUG_CONTROL,
"[color profile] colord gave us a new screen profile: '%s' (size: %ld)\n", filename, size);
}
else
{
g_free(tmp_data);
}
}
}
}
Expand Down

0 comments on commit e9f50c3

Please sign in to comment.