From: Seungha Son Date: Mon, 16 Oct 2017 03:22:08 +0000 (+0900) Subject: Add set_last_result() to check error X-Git-Tag: submit/tizen/20171018.011846~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=121d0bf2eef642ab7657edb58cc93712354edded;p=platform%2Fcore%2Fapi%2Fnotification.git Add set_last_result() to check error Signed-off-by: Seungha Son Change-Id: Ib8224aa5a04e6c794c46573d50056a0abef2dd4f --- diff --git a/src/notification_internal.c b/src/notification_internal.c index 0519daa7..3a79332a 100755 --- a/src/notification_internal.c +++ b/src/notification_internal.c @@ -1014,15 +1014,19 @@ notification_h notification_load_for_uid(char *app_id, noti = (notification_h)calloc(1, sizeof(struct _notification)); if (noti == NULL) { NOTIFICATION_ERR("Failed to alloc memory"); + set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; } ret = notification_ipc_request_load_noti_by_priv_id(noti, app_id, priv_id, uid); if (ret != NOTIFICATION_ERROR_NONE) { notification_free(noti); + set_last_result(ret); return NULL; } + set_last_result(NOTIFICATION_ERROR_NONE); + return noti; } /* LCOV_EXCL_STOP */