projects
/
platform
/
core
/
connectivity
/
bluetooth-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add checking memory allocation
[platform/core/connectivity/bluetooth-agent.git]
/
hf-agent
/
bluetooth-hf-agent.c
diff --git
a/hf-agent/bluetooth-hf-agent.c
b/hf-agent/bluetooth-hf-agent.c
index
671432c
..
ed9799b
100644
(file)
--- a/
hf-agent/bluetooth-hf-agent.c
+++ b/
hf-agent/bluetooth-hf-agent.c
@@
-1041,6
+1041,11
@@
gboolean __bt_hf_agent_add_queue(GDBusMethodInvocation *context, char *at,
pending_flag ? "TRUE" : "FALSE");
bt_hf_agent_send_at_info *cmd = g_new0(bt_hf_agent_send_at_info, 1);
+ if (!cmd) {
+ ERR("failed to allocate cmd");
+ return FALSE;
+ }
+
cmd->id = ++g_id;
memcpy(cmd->at_cmd, at, count);
cmd->count = count;