From 32b0ca999325628fcca1a815bc87d939df938392 Mon Sep 17 00:00:00 2001 From: Myungki Lee Date: Mon, 6 Mar 2017 20:22:17 +0900 Subject: [PATCH] Fix timeout issue when noti add, update - did not check error Change-Id: I5fae426d6ac693feb0928c3df01b905c3ed5b4a4 Signed-off-by: Myungki Lee --- src/notification_service.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/notification_service.c b/src/notification_service.c index 66cc2dd..8b64146 100755 --- a/src/notification_service.c +++ b/src/notification_service.c @@ -598,7 +598,7 @@ int notification_add_noti(GVariant *parameters, GVariant **reply_body, const cha ret = _validate_and_set_noti_with_uid(uid, noti, ¬i_uid); if (ret != NOTIFICATION_ERROR_NONE) - return ret; + goto out; ret = notification_noti_check_tag(noti); if (ret == NOTIFICATION_ERROR_NOT_EXIST_ID) @@ -606,22 +606,27 @@ int notification_add_noti(GVariant *parameters, GVariant **reply_body, const cha else if (ret == NOTIFICATION_ERROR_ALREADY_EXIST_ID) ret = _update_noti(reply_body, noti, noti_uid); + if (ret != NOTIFICATION_ERROR_NONE) + goto out; + ret = notification_get_event_flag(noti, &event_flag); if (ret != NOTIFICATION_ERROR_NONE) - return ret; + goto out; if (event_flag == true) { ret = notification_get_id(noti, NULL, &priv_id); if (ret != NOTIFICATION_ERROR_NONE) - return ret; + goto out; __add_sender_info(priv_id, sender); } - notification_free(noti); } else { ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; } +out: + notification_free(noti); + DbgPrint("notification_add_noti ret : %d", ret); return ret; } @@ -679,15 +684,16 @@ int notification_update_noti(GVariant *parameters, GVariant **reply_body, uid_t ret = _validate_and_set_noti_with_uid(uid, noti, ¬i_uid); if (ret != NOTIFICATION_ERROR_NONE) - return ret; + goto out; - if (ret == NOTIFICATION_ERROR_NONE) - ret = _update_noti(reply_body, noti, noti_uid); + ret = _update_noti(reply_body, noti, noti_uid); - notification_free(noti); } else { ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; } + +out: + notification_free(noti); return ret; } -- 2.7.4