Fix the coverity issue
[platform/core/connectivity/bluetooth-agent.git] / hf-agent / bluetooth-hf-agent.c
index 671432c..87d2611 100644 (file)
@@ -461,7 +461,7 @@ static gboolean __clcc_async_timer_func(gpointer data)
 
 static void __hf_agent_method(GDBusConnection *connection,
                            const gchar *sender,
-                           const gchar *object_path,
+                           const gchar *path,
                            const gchar *interface_name,
                            const gchar *method_name,
                            GVariant *parameters,
@@ -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;