summaryrefslogtreecommitdiff
path: root/alarm-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'alarm-manager.c')
-rw-r--r--alarm-manager.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/alarm-manager.c b/alarm-manager.c
index 50180b7..5169c0c 100644
--- a/alarm-manager.c
+++ b/alarm-manager.c
@@ -1649,8 +1649,14 @@ static void __alarm_send_noti_to_application_reply(
g_error_free(error);
if (is_existed) {
- entry->zombie_mode = true;
watch_info = (struct watch_info_t *)calloc(1, sizeof(struct watch_info_t));
+ if (watch_info == NULL) {
+ ALARM_MGR_EXCEPTION_PRINT("Out of memory");
+ free(reply_alarm_id);
+ return;
+ }
+
+ entry->zombie_mode = true;
watch_info->alarm_id = entry->alarm_id;
watch_info->watch_id = g_bus_watch_name_on_connection(
alarm_context.connection,
@@ -1700,6 +1706,11 @@ static void __alarm_send_noti_to_application(const char *app_service_name,
alarm_id, service_name);
} else {
reply_alarm_id = (alarm_id_t *)calloc(1, sizeof(alarm_id_t));
+ if (reply_alarm_id == NULL) {
+ ALARM_MGR_EXCEPTION_PRINT("Out of memory");
+ return;
+ }
+
*reply_alarm_id = alarm_id;
g_dbus_connection_call(alarm_context.connection,
service_name,