Fix the Svace issue 98/87298/1
authorHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 7 Sep 2016 08:59:05 +0000 (17:59 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Wed, 7 Sep 2016 08:59:05 +0000 (17:59 +0900)
- WGID : 11764, 11765
- WGID : 12365, 12365
- WGID : 13161, 13162
- WGID : 13805, 14576

Change-Id: Ic75ba6ddcafe6f5e7179e343c04178aa34dd7e26
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
bt-api/bt-gatt-service.c
bt-service/bt-service-opp-client.c
bt-service/bt-service-pbap.c

index fc9b4ce..7ec424c 100644 (file)
@@ -1943,6 +1943,7 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
        char_info = __bt_gatt_find_gatt_char_info(serv_path, char_path);
        if (char_info == NULL) {
                g_strfreev(line_argv);
+               g_free(serv_path);
                return BLUETOOTH_ERROR_INVALID_PARAM;
        }
 
@@ -1951,6 +1952,7 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
 
        if (node_info == NULL) {
                g_strfreev(line_argv);
+               g_free(serv_path);
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
@@ -1967,6 +1969,7 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
                g_error_free(error);
                g_free(path);
                g_strfreev(line_argv);
+               g_free(serv_path);
 
                return BLUETOOTH_ERROR_INTERNAL;
        }
@@ -2019,6 +2022,7 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
        *desc_path = g_strdup(path);
 
        g_free(path);
+       g_free(serv_path);
        g_strfreev(line_argv);
        g_variant_builder_unref(inner_builder);
        g_variant_builder_unref(builder);
@@ -2231,6 +2235,7 @@ BT_EXPORT_API int bluetooth_gatt_update_characteristic(
 
        if (!__bt_gatt_get_service_state(serv_path)) {
                BT_DBG("service not registered for this characteristic \n");
+               g_free(serv_path);
                g_strfreev(line_argv);
                return BLUETOOTH_ERROR_INTERNAL;
        }
@@ -2272,6 +2277,12 @@ BT_EXPORT_API int bluetooth_gatt_update_characteristic(
 
                char_info = __bt_gatt_find_gatt_char_info(serv_path, char_path);
                if (char_info == NULL) {
+                       g_free(serv_path);
+                       g_strfreev(line_argv);
+                       g_variant_builder_unref(inner_builder);
+                       g_variant_builder_unref(outer_builder);
+                       g_variant_builder_unref(invalidated_builder);
+
                        return BLUETOOTH_ERROR_INVALID_DATA;
                }
 
@@ -2285,6 +2296,7 @@ BT_EXPORT_API int bluetooth_gatt_update_characteristic(
                }
        }
 
+       g_free(serv_path);
        g_strfreev(line_argv);
        g_variant_builder_unref(inner_builder);
        g_variant_builder_unref(outer_builder);
index cb35701..152a556 100644 (file)
@@ -561,6 +561,9 @@ static void __bt_send_file_cb(GDBusProxy *proxy,
        sending_info->transfer_info->transfer_status = BT_TRANSFER_STATUS_QUEUED;
        sending_info->result = BLUETOOTH_ERROR_NONE;
        file_offset++;
+
+       g_free((gchar *)transfer_name);
+       g_free((gchar *)file_name);
 }
 
 void _bt_sending_files(void)
index d8d046a..1b5aee3 100644 (file)
@@ -1214,6 +1214,8 @@ int _bt_pbap_get_phonebook(const bluetooth_device_address_t *address,
        pbap_data->app_param = param;
 
        if (source ==  selected_path.folder && type == selected_path.type) {
+               g_free(source_string);
+               g_free(type_string);
                return __bt_pbap_call_get_phonebook(g_pbap_session_proxy, pbap_data);
        }
 
@@ -1358,6 +1360,8 @@ int _bt_pbap_pull_vcard(const bluetooth_device_address_t *address,
                        ERR("Unable to create proxy: %s", err->message);
                        g_clear_error(&err);
                }
+               g_free(source_string);
+               g_free(type_string);
                return -1;
        }
 
@@ -1369,6 +1373,8 @@ int _bt_pbap_pull_vcard(const bluetooth_device_address_t *address,
        pbap_data->app_param = param;
 
        if (source ==  selected_path.folder && type == selected_path.type) {
+               g_free(source_string);
+               g_free(type_string);
                return __bt_pbap_call_get_vcard(g_pbap_session_proxy, pbap_data);
        }