fix memory leak. 79/70979/1 accepted/tizen/common/20160530.132225 accepted/tizen/mobile/20160524.005326 accepted/tizen/wearable/20160524.005323 submit/tizen_common/20160530.122415 submit/tizen_mobile/20160523.125036 submit/tizen_wearable/20160523.125114
authorjiseob.jang <jiseob.jang@samsung.com>
Mon, 23 May 2016 12:29:18 +0000 (21:29 +0900)
committerjiseob.jang <jiseob.jang@samsung.com>
Mon, 23 May 2016 12:29:18 +0000 (21:29 +0900)
Change-Id: I22c363e668d027305d14ad8d142b63c2a4e3a841
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
CMakeLists.txt
packaging/libaccount-service.spec
src/account.c

index 56a9003..8c791dd 100644 (file)
@@ -6,6 +6,6 @@ SET(EXEC_PREFIX ${_prefix})
 #SET(LIBDIR "\${prefix}/lib")
 #SET(INCLUDEDIR "\${prefix}/include ")
 SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.4.1")
+SET(VERSION "${VERSION_MAJOR}.4.2")
 
 ADD_SUBDIRECTORY(src)
index e981d54..44a5161 100644 (file)
@@ -1,7 +1,7 @@
 
 Name:       libaccount-service
 Summary:    Account DB library
-Version:    0.4.1
+Version:    0.4.2
 Release:    1
 Group:      Social & Content/API
 License:    Apache-2.0
index 4d0da30..58ec184 100644 (file)
@@ -203,6 +203,8 @@ ACCOUNT_API int account_insert_to_db(account_h account, int *account_db_id)
 
        _INFO("3. Before account_manager_call_account_add_sync");
        bool is_success = account_manager_call_account_add_sync(acc_mgr, account_serialized, (int)getuid(), &db_id, NULL, &error);
+       g_variant_unref(account_serialized);
+
        ACCOUNT_CATCH_ERROR((is_success != false), {}, _account_get_error_code(is_success, error), "Failed to get dbus.");
        g_clear_error(&error);
 
@@ -393,6 +395,7 @@ ACCOUNT_API int account_update_to_db_by_id(account_h account, int account_id)
        _INFO("3. Before account_manager_call_account_update_to_db_by_id_sync");
        GVariant *account_serialized = marshal_account((account_s *)account);
        is_success = account_manager_call_account_update_to_db_by_id_sync(acc_mgr, account_serialized, account_id, (int)getuid(), NULL, &error);
+       g_variant_unref(account_serialized);
 
        if (!is_success) {
                error_code = _account_get_error_code(is_success, error);
@@ -452,6 +455,7 @@ ACCOUNT_INTERNAL_API int account_update_to_db_by_id_without_permission(account_h
 
        _INFO("before call update() : account_id[%d]", account_id);
        is_success = account_manager_call_account_update_to_db_by_id_ex_sync(acc_mgr, account_serialized, account_id, (int)getuid(), NULL, &error);
+       g_variant_unref(account_serialized);
 
        _INFO("after call update() : is_success=%d", is_success);
        if (!is_success) {
@@ -496,6 +500,7 @@ ACCOUNT_API int account_update_to_db_by_user_name(account_h account, const char
 
        GVariant *account_serialized = marshal_account(account_data);
        is_success = account_manager_call_account_update_to_db_by_user_name_sync(acc_mgr, account_serialized, user_name, package_name, (int)getuid(), NULL, &error);
+       g_variant_unref(account_serialized);
 
        if (!is_success) {
                error_code = _account_get_error_code(is_success, error);
@@ -1401,6 +1406,7 @@ ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h
 
        _INFO("before unmarshal_account");
        account_s *account_data = umarshal_account(account_variant);
+       g_variant_unref(account_variant);
        _INFO("after unmarshal_account");
 
        if (account_data == NULL) {
@@ -1631,6 +1637,7 @@ ACCOUNT_API int account_query_capability_by_account_id(capability_cb callback, i
                return error_code;
 
        GSList *capability_list = unmarshal_capability_list(capability_list_variant);
+       g_variant_unref(capability_list_variant);
 
        if (capability_list == NULL)
                return ACCOUNT_ERROR_NO_DATA;
@@ -2265,6 +2272,7 @@ ACCOUNT_INTERNAL_API int account_type_insert_to_db(account_type_h account_type,
        int db_id = -1;
        GVariant *account_type_serialized = marshal_account_type((account_type_s *)account_type);
        bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_type_serialized, (int)getuid(), &db_id, NULL, &error);
+       g_variant_unref(account_type_serialized);
 
        int ret = _account_get_error_code(is_success, error);
        g_clear_error(&error);
@@ -2305,6 +2313,7 @@ ACCOUNT_INTERNAL_API int account_type_update_to_db_by_app_id(const account_type_
        }
 
        bool is_success = account_manager_call_account_type_update_to_db_by_app_id_sync(acc_mgr, account_type_variant, app_id, (int)getuid(), NULL, &error);
+       g_variant_unref(account_type_variant);
 
        error_code = _account_get_error_code(is_success, error);
        g_clear_error(&error);