From 6ae56b61cf3e2e25515918be2bd405d8d5a36590 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Thu, 24 May 2018 10:54:52 +0800 Subject: [PATCH] Component/bt: fix notify memory leak for v3.0 --- components/bt/bluedroid/btc/core/btc_main.c | 2 ++ components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/components/bt/bluedroid/btc/core/btc_main.c b/components/bt/bluedroid/btc/core/btc_main.c index 84473b58e..b4ef34cbe 100644 --- a/components/bt/bluedroid/btc/core/btc_main.c +++ b/components/bt/bluedroid/btc/core/btc_main.c @@ -41,7 +41,9 @@ static void btc_enable_bluetooth(void) static void btc_disable_bluetooth(void) { +#if (SMP_INCLUDED) btc_config_shut_down(); +#endif /* #if (SMP_INCLUDED) */ if (BTA_DisableBluetooth() != BTA_SUCCESS) { future_ready(*btc_main_get_future_p(BTC_MAIN_DISABLE_FUTURE), FUTURE_FAIL); } diff --git a/components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c b/components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c index 8ffafd7e8..c3599a722 100644 --- a/components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c +++ b/components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c @@ -209,6 +209,9 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data) break; case BTA_GATTS_CONF_EVT: LOG_DEBUG("CONIRM EVT\n"); + if (p_data && p_data->req_data.value){ + osi_free(p_data->req_data.value); + } /* Nothing */ break; case BTA_GATTS_CREATE_EVT: