[UTC][bluetooth][Non-ACR][Fix the crash in abnormal case] 84/234384/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 26 May 2020 04:10:46 +0000 (13:10 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 26 May 2020 04:12:44 +0000 (13:12 +0900)
Change-Id: I1727eb469494b66d656fd595769497f3f8b29631
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/utc/bluetooth/utc_bluetooth_adapter_positive.c

index c5fbd4b94c487fac239e89112a22e0c6f87b4d75..d4de1c75595c26d828895c00d9924c91bac1fdd2 100755 (executable)
@@ -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 {