Fix the svace issue (67042) 79/115879/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 21 Feb 2017 23:28:46 +0000 (08:28 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 21 Feb 2017 23:29:22 +0000 (08:29 +0900)
Change-Id: If5ac7da29996f4d4b5d6c8f2a1e24dba58986a77
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
ag-agent/bluetooth-ag-agent.c

index 7bfdb17..9555899 100755 (executable)
@@ -1636,7 +1636,7 @@ static bt_hfp_agent_error_t __bt_hfp_send_bcs_command(bt_ag_info_t *hs,
                        gboolean init_by_hf)
 {
        uint32_t codec;
-       struct ag_codec *data = g_new0(struct ag_codec, 1);
+       struct ag_codec *data = NULL;;
 
 #ifdef TIZEN_FEATURE_BT_KIRAN_DEVICE
        codec = BT_CVSD_CODEC_ID;
@@ -1663,6 +1663,10 @@ static bt_hfp_agent_error_t __bt_hfp_send_bcs_command(bt_ag_info_t *hs,
        hs->codec_info.requested_by_hf = init_by_hf;
        hs->codec_info.final_codec = codec;
 
+       data = g_new0(struct ag_codec, 1);
+       if (data == NULL)
+               return BT_HFP_AGENT_ERROR_NO_MEMORY;
+
        data->bt_ag_info = hs;
        data->codec_status = g_strdup("timeout");