]> granicus.if.org Git - esp-idf/commit
components/bt: Fix a probable memory leak for BTA_GATTS_CONF_EVT event (backport...
authorHrishikesh Dhayagude <hrishi@espressif.com>
Wed, 8 Aug 2018 08:46:03 +0000 (14:16 +0530)
committerHrishikesh Dhayagude <hrishi@espressif.com>
Mon, 27 Aug 2018 06:33:20 +0000 (12:03 +0530)
commit7ffd68cac25fa06008f82fd17d00fd9188ec4adf
treec4b3e9bca0352b9ea3dc55747c67feaf3e3a8964
parent7cd75f30f275e91a68b69856d70fcae37354b665
components/bt: Fix a probable memory leak for BTA_GATTS_CONF_EVT event (backport v3.1)

Multiple modules register their callback BTA_GATTS_AppRegister().

If any of the callbacks do not free the allocated pointer in
BTA_GATTS_CONF_EVT event, then this can result in memory leak.

So, free the pointer after the callback function is called and remove
the calls to free in the callback functions as it is now not required

Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
components/bt/bluedroid/bta/gatt/bta_gatts_act.c
components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c
components/bt/bluedroid/btc/profile/std/gatt/btc_gatts.c