gatt client: Fix SIGABRT 68/163368/1 accepted/tizen_3.0_common accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable tizen_3.0 accepted/tizen/3.0/common/20171214.102437 accepted/tizen/3.0/mobile/20171214.091005 accepted/tizen/3.0/tv/20171214.091010 accepted/tizen/3.0/wearable/20171214.091015 submit/tizen_3.0/20171211.001202
authorAnupam Roy <anupam.r@samsung.com>
Mon, 13 Nov 2017 12:35:02 +0000 (18:05 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 11 Dec 2017 00:11:08 +0000 (09:11 +0900)
JIRA Issue: http://suprem.sec.samsung.net/jira/browse/TSAM-14037

[Problem] Application terminates when GATT descriptor
          'WriteValue' API fails.
[Cause] In case of error in BlueZ DBUS API 'WriteValue', NULL
        is received in g_dbus_connection_call_finish() in gatt
        client. So, instead of returning after chekcing
        error value, code was trying to unref NULL value causing
        application to terminate abnormally.
[Measure] Return from GATT write descriptor callback, in case of error.
[Checking Method] Perform GATT desc 'WriteValue' using bt_unit_test.

Change-Id: Iadddd7084b1a76acb7667e77c4acf7e6a0a9a4f5
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
bt-api/bt-gatt-client.c

index af3c69f..3b8228c 100644 (file)
@@ -1463,6 +1463,7 @@ static void __bluetooth_internal_write_desc_cb(GObject *source_object,
                                BLUETOOTH_ERROR_INTERNAL, resp_data,
                                user_info->cb, user_info->user_data);
                g_free(resp_data);
+               return;
        }
 
        g_variant_get(value, "(y)", &att_ecode);