From: Tedd Ho-Jeong An <tedd.an@xxxxxxxxx> This patch fixes the assertion by resetting the GError variable to NULL. bluetoothd[370193]: GLib: g_file_set_contents: assertion 'error == NULL || *error == NULL' failed bluetoothd[370193]: ++++++++ backtrace ++++++++ bluetoothd[370193]: #1 g_logv+0x21c (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6) [0x7f314559455c] bluetoothd[370193]: #2 g_log+0x93 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6) [0x7f3145594743] bluetoothd[370193]: #3 g_file_set_contents+0x68 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6) [0x7f3145577a68] bluetoothd[370193]: #4 store_device_info_cb+0x3b6 (src/device.c:475) [0x55be0a3591e6] bluetoothd[370193]: #5 g_main_context_dispatch+0x14e (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6) [0x7f314558d04e] bluetoothd[370193]: #6 ?? (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6) [0x7f314558d400] bluetoothd[370193]: #7 g_main_loop_run+0x83 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.6) [0x7f314558d6f3] bluetoothd[370193]: #8 mainloop_run+0x19 (src/shared/mainloop-glib.c:68) [0x55be0a394149] bluetoothd[370193]: #9 mainloop_run_with_signal+0xf0 (src/shared/mainloop-notify.c:190) [0x55be0a3945b0] bluetoothd[370193]: #10 main+0xabc (src/main.c:1212) [0x55be0a2d9d9c] bluetoothd[370193]: #11 __libc_start_main+0xf3 (../csu/libc-start.c:342) [0x7f314521e0b3] bluetoothd[370193]: #12 _start+0x2e (/home/han1/work/dev/bluez/src/bluetoothd) [0x55be0a2dac7e] bluetoothd[370193]: +++++++++++++++++++++++++++ --- src/device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/device.c b/src/device.c index d5aae9576..f3cd69003 100644 --- a/src/device.c +++ b/src/device.c @@ -399,6 +399,7 @@ static gboolean store_device_info_cb(gpointer user_data) error("Unable to load key file from %s: (%s)", filename, gerr->message); g_error_free(gerr); + gerr = NULL; } g_key_file_set_string(key_file, "General", "Name", device->name); -- 2.25.1