From 3892a92d803a9e62f1f954aed08d010cf1e930eb Mon Sep 17 00:00:00 2001 From: xiewenxiang Date: Mon, 7 Jun 2021 17:56:55 +0800 Subject: [PATCH] component/bt: fix enable gattc nvs cache lead to crash --- components/bt/host/bluedroid/bta/gatt/bta_gattc_co.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/bt/host/bluedroid/bta/gatt/bta_gattc_co.c b/components/bt/host/bluedroid/bta/gatt/bta_gattc_co.c index a336c23147..b5f7149c49 100644 --- a/components/bt/host/bluedroid/bta/gatt/bta_gattc_co.c +++ b/components/bt/host/bluedroid/bta/gatt/bta_gattc_co.c @@ -394,6 +394,8 @@ void bta_gattc_co_cache_addr_init(void) return; } + memset(cache_env, 0x0, sizeof(cache_env_t)); + if ((err_code = nvs_open(cache_addr, NVS_READWRITE, &fp)) == ESP_OK) { cache_env->addr_fp = fp; cache_env->is_open = TRUE;