char *due_time_str = ctime(&(info->due_time));
if (due_time_str)
due_time_str[strlen(due_time_str) - 1] = '\0'; /* to avoid new line */
-
- char *timebuf = strdup(ctime(&info->due_time));
- if (timebuf)
- timebuf[strlen(timebuf) - 1] = '\0'; /* to avoid new line */
+ else
+ due_time_str = "NULL";
snprintf(log_message, sizeof(log_message),
"alarmID: %d, uid: %d, caller : %s -> callee : %s, "
info->alarm_id, info->uid, info->app_unique_name, info->callee_pkgid,
info->dst_service_name, info->dst_service_name_mod,
info->alarm_info.alarm_type, info->alarm_info.mode.repeat,
- info->alarm_info.mode.u_interval.interval, info->due_time, timebuf);
-
- if (timebuf)
- free(timebuf);
+ info->alarm_info.mode.u_interval.interval, info->due_time, due_time_str);
_save_module_log(tag, log_message);
#endif /* _APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG */