Fix the Svace issue 24/97024/1 submit/tizen_3.0/20161111.041011
authorHyuk Lee <hyuk0512.lee@samsung.com>
Fri, 11 Nov 2016 04:01:59 +0000 (13:01 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Fri, 11 Nov 2016 04:02:24 +0000 (13:02 +0900)
Change-Id: I3017c03e1cf480ba6e983e2d2a8584654b6ceb28
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
bt-service/bt-service-event-sender.c
bt-service/bt-service-pbap.c
bt-service/bt-service-proximity.c
test/bluetooth-frwk-test.c

index 19df7fd..d269e75 100644 (file)
@@ -423,6 +423,7 @@ int _bt_send_event(int event_type, int event, GVariant *param)
                break;
        case BLUETOOTH_EVENT_REMOTE_IBEACON_DEVICE_FOUND:
                signal = BT_IBEACON_DEVICE_FOUND;
+               break;
        case BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED:
                signal = BT_PXP_PROPERTY_CHANGED;
                break;
index 9cbf004..d69b66a 100644 (file)
@@ -1151,6 +1151,8 @@ int _bt_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
        g_conn = _bt_gdbus_get_session_gconn();
        if (g_conn == NULL) {
                BT_ERR("Couldn't connect to session bus");
+               g_free(source_string);
+               g_free(type_string);
                return 0;
        }
        g_pbap_session_proxy =  g_dbus_proxy_new_sync(g_conn,
@@ -1238,6 +1240,8 @@ int _bt_pbap_get_phonebook(const bluetooth_device_address_t *address,
        g_conn = _bt_gdbus_get_session_gconn();
        if (g_conn == NULL) {
                BT_ERR("Couldn't connect to session bus");
+               g_free(source_string);
+               g_free(type_string);
                return 0;
        }
        g_pbap_session_proxy =  g_dbus_proxy_new_sync(g_conn,
@@ -1324,6 +1328,8 @@ int _bt_pbap_get_list(const bluetooth_device_address_t *address, int source,
        g_conn = _bt_gdbus_get_session_gconn();
        if (g_conn == NULL) {
                BT_ERR("Couldn't connect to session bus");
+               g_free(source_string);
+               g_free(type_string);
                return 0;
        }
        g_pbap_session_proxy =  g_dbus_proxy_new_sync(g_conn,
@@ -1411,6 +1417,8 @@ int _bt_pbap_pull_vcard(const bluetooth_device_address_t *address,
        g_conn = _bt_gdbus_get_session_gconn();
        if (g_conn == NULL) {
                BT_ERR("Couldn't connect to session bus");
+               g_free(source_string);
+               g_free(type_string);
                return 0;
        }
        g_pbap_session_proxy =  g_dbus_proxy_new_sync(g_conn,
@@ -1496,6 +1504,8 @@ int _bt_pbap_phonebook_search(const bluetooth_device_address_t *address,
        g_conn = _bt_gdbus_get_session_gconn();
        if (g_conn == NULL) {
                BT_ERR("Couldn't connect to session bus");
+               g_free(source_string);
+               g_free(type_string);
                return 0;
        }
        g_pbap_session_proxy =  g_dbus_proxy_new_sync(g_conn,
index 6ed4b6b..957bd6f 100644 (file)
@@ -93,8 +93,11 @@ int bt_set_proximity_property(bluetooth_device_address_t *device_address,
        value_str = _bt_convert_alert_level_to_string(alert_level);
        property_str =_bt_convert_property_to_string(property);
 
-       if (value_str == NULL || property_str == NULL)
+       if (value_str == NULL || property_str == NULL) {
+               g_free(property_str);
+               g_free(value_str);
                return BLUETOOTH_ERROR_INTERNAL;
+       }
 
        proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
                                                        NULL, BT_BLUEZ_NAME,
index 7636eea..643679b 100644 (file)
@@ -1399,8 +1399,8 @@ void bt_event_callback(int event, bluetooth_event_param_t* param, void *user_dat
                        tc_result(TC_FAIL, 15);
                        TC_PRT("*****API failed ***** ");
                }
-               break;
 #endif
+               break;
        }
 
        case BLUETOOTH_EVENT_SERVICE_SEARCHED: