Fix the svace issue (67042) 68/116068/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 21 Feb 2017 23:28:46 +0000 (08:28 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 23 Feb 2017 00:26:32 +0000 (09:26 +0900)
Change-Id: I84a4e28434cce5382578cff8b4f1bd9b546d5552
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");