From: DoHyun Pyun Date: Tue, 26 May 2020 04:10:46 +0000 (+0900) Subject: [UTC][bluetooth][Non-ACR][Fix the crash in abnormal case] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F234384%2F1;p=test%2Ftct%2Fnative%2Fapi.git [UTC][bluetooth][Non-ACR][Fix the crash in abnormal case] Change-Id: I1727eb469494b66d656fd595769497f3f8b29631 Signed-off-by: DoHyun Pyun --- diff --git a/src/utc/bluetooth/utc_bluetooth_adapter_positive.c b/src/utc/bluetooth/utc_bluetooth_adapter_positive.c index c5fbd4b94..d4de1c755 100755 --- a/src/utc/bluetooth/utc_bluetooth_adapter_positive.c +++ b/src/utc/bluetooth/utc_bluetooth_adapter_positive.c @@ -1335,8 +1335,10 @@ int utc_bluetooth_bt_adapter_get_local_oob_ext_data_p(void) &data[0], &data[1], &len[0], &len[1], &data[2], &data[3], &len[2], &len[3]); - for (i = 0; i < 4; i++) - g_free(data[i]); + if (ret == BT_ERROR_NONE) { + for (i = 0; i < 4; i++) + g_free(data[i]); + } assert_eq(ret, BT_ERROR_NONE); } else {