modified wrong exception return value of calloc into ERROR_OUT_OF_MEMORY 89/47589/3
authorjiwon44.park <jiwon44.park@samsung.com>
Wed, 2 Sep 2015 01:42:04 +0000 (10:42 +0900)
committerjeesun kim <iamjs.kim@samsung.com>
Wed, 9 Sep 2015 03:08:59 +0000 (20:08 -0700)
Change-Id: I1026914ecf3c1fedc252594242207941a5644719
Signed-off-by: jiwon44.park <jiwon44.park@samsung.com>
server/cal_server_alarm.c
server/db/cal_db_plugin_event.c

index 3a6cb98..3df9236 100644 (file)
@@ -770,7 +770,7 @@ static bool __app_matched_cb(app_control_h app_control, const char *package, voi
        if (NULL == ids) {
                ERR("calloc() Fail");
                app_control_destroy(b);
-               return CALENDAR_ERROR_DB_FAILED;
+               return CALENDAR_ERROR_OUT_OF_MEMORY;
        }
        GList *l = g_list_first(alarm_list);
        int i;
index 547ee12..abc21fd 100644 (file)
@@ -316,7 +316,7 @@ static int __get_time_shifted_field(char *old_field, int old_type, int new_type,
        if (NULL == new) {
                ERR("calloc() Fail");
                g_strfreev(t);
-               return CALENDAR_ERROR_DB_FAILED;
+               return CALENDAR_ERROR_OUT_OF_MEMORY;
        }
 
        struct tm tm = {0};
@@ -830,7 +830,7 @@ static int _cal_db_event_add_exdate(int original_event_id, char* recurrence_id)
                        if (NULL == exdate) {
                                ERR("calloc() Fail");
                                sqlite3_finalize(stmt);
-                               return CALENDAR_ERROR_DB_FAILED;
+                               return CALENDAR_ERROR_OUT_OF_MEMORY;
                        }
                        snprintf(exdate, len, "%s,%s", temp, recurrence_id);
                        DBG("append [%s] to aleady has exdate [%s]", temp, recurrence_id);
@@ -2592,7 +2592,7 @@ static int _cal_db_event_exdate_insert_normal(int event_id, const char* original
        }
 
        int *ids = calloc(len1, sizeof(int));
-       RETVM_IF(NULL == ids, CALENDAR_ERROR_DB_FAILED, "calloc() Fail");
+       RETVM_IF(NULL == ids, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
 
        int exception_count = 0;
        for(i = 0; i < len1; i++) {