Apply tizen 3.0 based product patchsets
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-gatt-service.c
index a99a5da..7cb8ee8 100644 (file)
@@ -1624,6 +1624,7 @@ static GDBusConnection *__bt_gatt_get_gdbus_connection(void)
                                        NULL, /* GDBusAuthObserver */
                                        NULL,
                                        &err);
+               g_free(address);
                if (!g_conn) {
                        if (err) {
                                BT_ERR("Unable to connect to dbus: %s", err->message);
@@ -1647,7 +1648,7 @@ static GDBusConnection *__bt_gatt_get_gdbus_connection(void)
                                        NULL, /* GDBusAuthObserver */
                                        NULL,
                                        &err);
-
+               g_free(address);
                if (!local_system_gconn) {
                        BT_ERR("Unable to connect to dbus: %s", err->message);
                        g_clear_error(&err);
@@ -1691,7 +1692,6 @@ BT_EXPORT_API int bluetooth_gatt_init(void)
        /* Register ObjectManager interface */
        node_info = __bt_gatt_create_method_node_info(
                                        manager_introspection_xml);
-
        if (node_info == NULL) {
                BT_ERR("failed to get node info");
                goto failed;
@@ -1705,7 +1705,7 @@ BT_EXPORT_API int bluetooth_gatt_init(void)
                                                        &manager_interface_vtable,
                                                        NULL, NULL, &error);
        }
-
+       g_dbus_node_info_unref(node_info);
        if (manager_id == 0) {
                BT_ERR("failed to register: %s", error->message);
                g_error_free(error);
@@ -1786,7 +1786,6 @@ BT_EXPORT_API int bluetooth_gatt_add_service(const char *svc_uuid,
 
        node_info = __bt_gatt_create_method_node_info(
                                        service_introspection_xml);
-
        if (node_info == NULL)
                return BLUETOOTH_ERROR_INTERNAL;
 
@@ -1797,6 +1796,7 @@ BT_EXPORT_API int bluetooth_gatt_add_service(const char *svc_uuid,
                                        node_info->interfaces[0],
                                        &serv_interface_vtable,
                                        NULL, NULL, &error);
+       g_dbus_node_info_unref(node_info);
 
        if (object_id == 0) {
                BT_ERR("failed to register: %s", error->message);
@@ -1890,7 +1890,6 @@ BT_EXPORT_API int bluetooth_gatt_add_new_characteristic(
 
        node_info = __bt_gatt_create_method_node_info(
                                        characteristics_introspection_xml);
-
        if (node_info == NULL)
                return BLUETOOTH_ERROR_INTERNAL;
 
@@ -1901,6 +1900,7 @@ BT_EXPORT_API int bluetooth_gatt_add_new_characteristic(
                                        node_info->interfaces[0],
                                        &char_interface_vtable,
                                        NULL, NULL, &error);
+       g_dbus_node_info_unref(node_info);
 
        if (object_id == 0) {
                BT_ERR("failed to register: %s", error->message);
@@ -2091,7 +2091,6 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
 
        node_info = __bt_gatt_create_method_node_info(
                                        descriptor_introspection_xml);
-
        if (node_info == NULL) {
                g_strfreev(line_argv);
                g_free(serv_path);
@@ -2105,6 +2104,7 @@ BT_EXPORT_API int bluetooth_gatt_add_descriptor(
                                node_info->interfaces[0],
                                &desc_interface_vtable,
                                NULL, NULL, &error);
+       g_dbus_node_info_unref(node_info);
 
        if (object_id == 0) {
                BT_ERR("failed to register: %s", error->message);
@@ -2166,6 +2166,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;
 }