From: DoHyun Pyun Date: Tue, 21 Feb 2017 23:28:46 +0000 (+0900) Subject: Fix the svace issue (67042) X-Git-Tag: accepted/tizen/3.0/common/20170223.122411~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F115879%2F1;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-agent.git Fix the svace issue (67042) Change-Id: If5ac7da29996f4d4b5d6c8f2a1e24dba58986a77 Signed-off-by: DoHyun Pyun --- diff --git a/ag-agent/bluetooth-ag-agent.c b/ag-agent/bluetooth-ag-agent.c index 7bfdb17..9555899 100755 --- a/ag-agent/bluetooth-ag-agent.c +++ b/ag-agent/bluetooth-ag-agent.c @@ -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");