Fix the svace issue 93/126193/3 submit/tizen/20170424.043020
authorHyuk Lee <hyuk0512.lee@samsung.com>
Thu, 20 Apr 2017 10:30:02 +0000 (19:30 +0900)
committerPyun DoHyun <dh79.pyun@samsung.com>
Mon, 24 Apr 2017 04:29:33 +0000 (04:29 +0000)
Change-Id: Ibcd74251d0cb1401b127995d1bef3073eeab1ee8
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
bt-api/bt-event-handler.c
bt-api/bt-hid-device.c
bt-service/bt-service-otp.c
bt-service/bt-service-tds.c
test/bluetooth-frwk-test.c

index a354dce98a39766bdd66d031f72315ae01af74bc..f53ee98543e7add3b7e468aed3ed60a33880b6fa 100644 (file)
@@ -2936,8 +2936,7 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
 
                if (data_len == 0) {
                        BT_ERR("No data");
-                       if (var)
-                               g_variant_unref(var);
+            g_variant_unref(var);
                        return;
                }
 
index 776a57a501abc6d9aec92e0468371e6b360ca2c0..52cc967b60f3d6e00177c165bc364f44abaa189c 100644 (file)
@@ -325,7 +325,7 @@ static gboolean __received_cb(GIOChannel *chan, GIOCondition cond,
 {
        hid_connected_device_info_t *info = data;
        GIOStatus status = G_IO_STATUS_NORMAL;
-       char buffer[20];
+       char buffer[BT_RFCOMM_BUFFER_LEN];
        gsize len = 0;
        GError *err = NULL;
        guint8  header, type, param;
index 432454e113fd5884032ab4245749e554238d601b..86354c0c377e5d38d42e62679b309c38a0076ebc 100644 (file)
@@ -136,6 +136,7 @@ int bt_otp_server_init(int request_id, const char *directory)
        otp_gproxy = _bt_core_gdbus_get_otp_proxy();
        if (!otp_gproxy) {
                BT_DBG("Couldn't get service proxy");
+               g_free(base_dir);
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
@@ -187,16 +188,19 @@ void server_deinit_cb(GObject *object, GAsyncResult *res,
 
        /* Send the event to application */
        _bt_send_event(BT_OTP_EVENT,
-               BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED,
-               param);
+                       BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED,
+                       param);
 
-       out_param = g_variant_new_from_data((const GVariantType *)"i",
+       if (req_info) {
+               out_param = g_variant_new_from_data((const GVariantType *)"i",
                                result, sizeof(int), TRUE, NULL, NULL);
 
-       g_dbus_method_invocation_return_value(req_info->context,
+               g_dbus_method_invocation_return_value(req_info->context,
                                g_variant_new("(iv)", status, out_param));
 
-       _bt_delete_request_list(req_info->req_id);
+               _bt_delete_request_list(req_info->req_id);
+       }
+
        g_variant_unref(result);
 
        if (otp_gproxy) {
index 90dcc26331afed1421f24bda91b6d39bef404c14..b7c40996d9b4f9544ed05806df6b0491894faea0 100644 (file)
@@ -1233,7 +1233,6 @@ static void __bt_tds_transport_data_read_desc_cb(GObject *source_object,
 
        if (error) {
                BT_ERR("Error : %s \n", error->message);
-               g_free(address);
                if (info) {
                        req_info = _bt_get_request_info(info->req_id);
                        __bt_tds_remove_data_read_req_info(info);
index 05ec47e871992f1b061b7de7a9f2b86f24660d39..eeeda98d1ae2bd41c7925bdbf82117ff21dd359b 100644 (file)
@@ -1186,19 +1186,20 @@ int test_input_callback(void *data)
                        perms, props, &char_obj_path);
 
                TC_PRT("characteristic obj_path is %s", char_obj_path);
-
+               g_free(char_uuid);
                break;
        }
 
        case 96: {
                char *desc_uuid = g_strdup("000026ff-0000-1000-8000-00805f9b34fb");
                bt_gatt_permission_t perms = BLUETOOTH_GATT_PERMISSION_READ |
-                               BLUETOOTH_GATT_PERMISSION_WRITE;
+                       BLUETOOTH_GATT_PERMISSION_WRITE;
 
                ret = bluetooth_gatt_add_descriptor(char_obj_path,
-                       desc_uuid, perms, &desc_obj_path);
-               TC_PRT("add descriptor error is %d", ret);
+                               desc_uuid, perms, &desc_obj_path);
 
+               TC_PRT("add descriptor error is %d", ret);
+               g_free(desc_uuid);
                break;
        }