Fix svace issues (183569, 183570, ...) 37/120937/1 accepted/tizen/3.0/common/20170327.141115 accepted/tizen/3.0/ivi/20170327.061525 accepted/tizen/3.0/mobile/20170327.061504 accepted/tizen/3.0/tv/20170327.061511 accepted/tizen/3.0/wearable/20170327.061518 submit/tizen_3.0/20170327.013857
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 27 Mar 2017 01:32:45 +0000 (10:32 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 27 Mar 2017 01:32:45 +0000 (10:32 +0900)
Change-Id: I3ad973688aca2fb1620d63b08d4d0bd457eb1f00
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-event-handler.c
bt-api/bt-gatt-service.c
bt-service/bt-service-event-receiver.c
bt-service/bt-service-tds.c

index 6395adb..9a3dcc1 100644 (file)
@@ -2908,6 +2908,7 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
                }
                buffer = (char *) g_variant_get_data(byte_var);
                memcpy(act_req.tds_data.data, buffer, act_req.tds_data.length);
+               g_free(buffer);
 
                _bt_convert_addr_string_to_type(act_req.rem_addr.addr, address);
 
@@ -2987,6 +2988,7 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
 
                buffer = (char *) g_variant_get_data(byte_var);
                memcpy(ind_res.tds_data.data, buffer, ind_res.tds_data.length);
+               g_free(buffer);
 
                _bt_convert_addr_string_to_type(ind_res.rem_addr.addr, address);
 
index 81a6ecc..969fc83 100644 (file)
@@ -2060,6 +2060,7 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
        g_strfreev(line_argv);
        g_variant_builder_unref(inner_builder);
        g_variant_builder_unref(builder);
+       g_variant_builder_unref(builder2);
 
        return BLUETOOTH_ERROR_NONE;
 }
@@ -2274,7 +2275,9 @@ BT_EXPORT_API int bluetooth_gatt_update_characteristic(
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
+/* Fix the svace issue : 185689
        outer_builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
+*/
        invalidated_builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
 
        inner_builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
@@ -2283,6 +2286,7 @@ BT_EXPORT_API int bluetooth_gatt_update_characteristic(
 
        update_value = g_variant_new("ay", inner_builder);
 
+
        outer_builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
        g_variant_builder_add(outer_builder, "{sv}", "Value",
                                        update_value);
index 6a8231c..51da38c 100644 (file)
@@ -2300,6 +2300,7 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                        ipsp_proxy = _bt_get_ipsp_proxy();
                        if (ipsp_proxy == NULL) {
                                BT_ERR("can not get ipsp proxy");
+                               g_free(address);
                                return;
                        }
 
@@ -2311,6 +2312,7 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                        ipsp_proxy = _bt_get_ipsp_proxy();
                        if (ipsp_proxy == NULL) {
                                BT_ERR("can not get ipsp proxy");
+                               g_free(address);
                                return;
                        }
 
index 0bc83aa..13e216c 100644 (file)
@@ -1157,12 +1157,16 @@ void _bt_tds_handle_activation_request(const char *path,
        if (0 == count)
                goto err;
 
+       g_free(address);
+
        BT_DBG("-");
        return;
 err:
        /* send activation response as error to bluez */
        __bt_tds_send_activation_response(address,
                TDS_CONTROL_POINT_RESPONSE_UNSUPPORTED_ORG_ID, NULL, 0);
+
+       g_free(address);
 }
 
 void _bt_tds_stop_by_terminated_process(char *name)