Code cleanup
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-pbap.c
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,