From: zhiweijian Date: Mon, 12 Nov 2018 11:41:19 +0000 (+0800) Subject: Component/bt: fix memory leak in service change X-Git-Tag: v3.2-beta3~105^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f7c54ae85102e664a5d8b0f2951becf642af95c;p=esp-idf Component/bt: fix memory leak in service change --- diff --git a/components/bt/bluedroid/stack/gatt/gatt_main.c b/components/bt/bluedroid/stack/gatt/gatt_main.c index aaec11d40a..af07313a57 100644 --- a/components/bt/bluedroid/stack/gatt/gatt_main.c +++ b/components/bt/bluedroid/stack/gatt/gatt_main.c @@ -188,6 +188,8 @@ void gatt_free(void) #if (GATTS_INCLUDED == TRUE) for (i = 0; i < GATT_MAX_SR_PROFILES; i++) { + gatt_remove_an_item_from_list(&gatt_cb.hdl_list_info, &gatt_cb.hdl_list[i]); + gatt_free_attr_value_buffer(&gatt_cb.hdl_list[i]); gatt_free_hdl_buffer(&gatt_cb.hdl_list[i]); } #endif /* #if (GATTS_INCLUDED == TRUE) */