Fix SVACE issues(Id: 11323, 11324, 169036, 171525, 171526) 27/113827/2 accepted/tizen/3.0/common/20170214.180329 accepted/tizen/3.0/ivi/20170213.225231 accepted/tizen/3.0/mobile/20170213.225138 accepted/tizen/3.0/tv/20170213.225209 accepted/tizen/3.0/wearable/20170213.225220 submit/tizen_3.0/20170213.044639
authorAtul Rai <a.rai@samsung.com>
Thu, 9 Feb 2017 04:41:09 +0000 (10:11 +0530)
committerAtul Rai <a.rai@samsung.com>
Thu, 9 Feb 2017 05:16:18 +0000 (10:46 +0530)
Change-Id: Ic10a120b3519c4f849c56ae6745d22ff09a2ddcf
Signed-off-by: Atul Rai <a.rai@samsung.com>
bt-service/bt-service-audio.c
bt-service/bt-service-event-receiver.c
bt-service/bt-service-proximity.c

index c72c6e1..fcc6302 100644 (file)
@@ -825,7 +825,8 @@ int _bt_audio_connect(int request_id, int type,
        value = __bt_is_headset_connected(type, request_id, address);
 
        if (value == BLUETOOTH_ERROR_ALREADY_CONNECT) {
-               return BLUETOOTH_ERROR_ALREADY_CONNECT;
+               result = BLUETOOTH_ERROR_ALREADY_CONNECT;
+               goto fail;
        } else if (value == BLUETOOTH_ERROR_NOT_CONNECTED) {
                value = __bt_is_headset_connecting(type);
                if (value != BLUETOOTH_ERROR_NONE) {
@@ -847,7 +848,8 @@ int _bt_audio_connect(int request_id, int type,
                /* Add data to the connected list */
                _bt_add_headset_to_list(type, BT_STATE_CONNECTING, address);
        } else if (value == BLUETOOTH_ERROR_IN_PROGRESS) {
-               return BLUETOOTH_ERROR_IN_PROGRESS;
+               result = BLUETOOTH_ERROR_IN_PROGRESS;
+               goto fail;
        }
 
        if (out_param1)
@@ -859,6 +861,9 @@ fail:
                g_array_append_vals(out_param1, address,
                                BT_ADDRESS_STR_LEN);
 
+       g_free(func_data->address);
+       g_free(func_data);
+
        return result;
 }
 
@@ -967,6 +972,9 @@ fail:
                g_array_append_vals(out_param1, address,
                                BT_ADDRESS_STR_LEN);
 
+       g_free(func_data->address);
+       g_free(func_data);
+
        return result;
 }
 
index 0244433..d60b5de 100644 (file)
@@ -2200,7 +2200,10 @@ void _bt_handle_device_event(GVariant *msg, const char *member, const char *path
                                                &le_dev_info->adv_data_len,
                                                &value);
 
-               ret_if(value == NULL);
+               if (value == NULL) {
+                       _bt_free_le_device_info(le_dev_info);
+                       return;
+               }
 
                _bt_convert_device_path_to_address(path, le_dev_info->address);
 
index f78e301..4c26c3c 100644 (file)
@@ -183,16 +183,20 @@ int _bt_proximity_monitor_get_property(bluetooth_device_address_t *device_addres
        BT_INFO("device_path is created[%s]", device_path);
 
        property_str = _bt_convert_property_to_string(property);
-
-       if (property_str == NULL)
+       if (property_str == NULL) {
+               g_free(device_path);
                return BLUETOOTH_ERROR_INTERNAL;
+       }
 
        proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
                                                        NULL, BT_BLUEZ_NAME,
                                                        device_path, BT_PROPERTIES_INTERFACE,  NULL, NULL);
 
        g_free(device_path);
-       retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
+       if (proxy == NULL) {
+               g_free(property_str);
+               return BLUETOOTH_ERROR_INTERNAL;
+       }
 
        result = g_dbus_proxy_call_sync(proxy, "GetAll",
                        g_variant_new("(s)", BT_PROXIMITY_MONITOR_INTERFACE),
@@ -206,6 +210,7 @@ int _bt_proximity_monitor_get_property(bluetooth_device_address_t *device_addres
                        g_error_free(error);
                }
                g_object_unref(proxy);
+               g_free(property_str);
                return BLUETOOTH_ERROR_INTERNAL;
        }
        g_variant_get(result , "(@a{sv})", &value);
@@ -215,6 +220,7 @@ int _bt_proximity_monitor_get_property(bluetooth_device_address_t *device_addres
        if (tmp_value == NULL) {
                g_object_unref(proxy);
                g_variant_unref(value);
+               g_free(property_str);
                return BLUETOOTH_ERROR_INTERNAL;
        }
 
@@ -261,16 +267,20 @@ int _bt_proximity_reporter_get_property(bluetooth_device_address_t *device_addre
        BT_INFO("device_path is created[%s]", device_path);
 
        property_str = _bt_convert_property_to_string(property);
-
-       if (property_str == NULL)
+       if (property_str == NULL) {
+               g_free(device_path);
                return BLUETOOTH_ERROR_INTERNAL;
+       }
 
        proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
                                                        NULL, BT_BLUEZ_NAME,
                                                        device_path, BT_PROPERTIES_INTERFACE,  NULL, NULL);
 
        g_free(device_path);
-       retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
+       if (proxy == NULL) {
+               g_free(property_str);
+               return BLUETOOTH_ERROR_INTERNAL;
+       }
 
        result = g_dbus_proxy_call_sync(proxy, "GetAll",
                        g_variant_new("(s)", BT_PROXIMITY_REPORTER_INTERFACE),
@@ -284,6 +294,7 @@ int _bt_proximity_reporter_get_property(bluetooth_device_address_t *device_addre
                        g_error_free(error);
                }
                g_object_unref(proxy);
+               g_free(property_str);
                return BLUETOOTH_ERROR_INTERNAL;
        }
        g_variant_get(result , "(@a{sv})", &value);
@@ -293,6 +304,7 @@ int _bt_proximity_reporter_get_property(bluetooth_device_address_t *device_addre
        if (tmp_value == NULL) {
                g_object_unref(proxy);
                g_variant_unref(value);
+               g_free(property_str);
                return BLUETOOTH_ERROR_INTERNAL;
        }