]> granicus.if.org Git - esp-idf/commitdiff
Component/bt: fix memory leak in service change char
authorzhiweijian <zhiweijian@espressif.com>
Mon, 5 Nov 2018 03:21:03 +0000 (11:21 +0800)
committerbot <bot@espressif.com>
Tue, 6 Nov 2018 08:43:59 +0000 (08:43 +0000)
components/bt/bluedroid/stack/gatt/gatt_main.c

index aaec11d40acb1cc99df4e01a2a54ba730e3f80eb..af07313a57753355572140bee2495d02c570f0cf 100644 (file)
@@ -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) */