summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/battery_dump/bm_listeners.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/battery_dump/bm_listeners.c b/src/battery_dump/bm_listeners.c
index cb90d99..7668ca2 100644
--- a/src/battery_dump/bm_listeners.c
+++ b/src/battery_dump/bm_listeners.c
@@ -2454,11 +2454,21 @@ static int bm_start_recording_event()
wakeup_hsp = 0; modem_hsp = 0; lock_ref_count = 0;
app_list = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+ if (!app_list) {
+ _ERR("Failed to create app-list table");
+ return -EWOULDBLOCK;
+ }
wakelock_list = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+ if (!wakelock_list) {
+ _ERR("Failed to create wakelock-list table");
+ g_hash_table_destroy(app_list);
+ app_list = NULL;
+ return -EWOULDBLOCK;
+ }
EXIT;
- return 0;
+ return BATTERY_MONITOR_ERROR_NONE;
}
static int bm_stop_recording_event()