Skip to content

Commit d19b095

Browse files
LebedevRIpmjdebruijn
authored andcommitted
dt_ctl_get_display_profile_colord_callback(): free icc buffer we just 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) (cherry picked from commit e9f50c3)
1 parent ce09fdd commit d19b095

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/control/control.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ static void dt_ctl_get_display_profile_colord_callback(GObject *source, GAsyncRe
137137
dt_print(DT_DEBUG_CONTROL,
138138
"[color profile] colord gave us a new screen profile: '%s' (size: %ld)\n", filename, size);
139139
}
140+
else
141+
{
142+
g_free(tmp_data);
143+
}
140144
}
141145
}
142146
}

0 commit comments

Comments
 (0)