From: yulong Date: Wed, 29 Nov 2017 02:50:03 +0000 (+0800) Subject: component/bt: reset the p_cmd_list pointer after release the mem. X-Git-Tag: v3.1-dev~13^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7353307ca5219f9906a7d00951b4e7740d0de331;p=esp-idf component/bt: reset the p_cmd_list pointer after release the mem. --- diff --git a/components/bt/bluedroid/bta/gatt/bta_gattc_utils.c b/components/bt/bluedroid/bta/gatt/bta_gattc_utils.c index 676ed851ac..70655fd944 100644 --- a/components/bt/bluedroid/bta/gatt/bta_gattc_utils.c +++ b/components/bt/bluedroid/bta/gatt/bta_gattc_utils.c @@ -312,6 +312,7 @@ void bta_gattc_clcb_dealloc(tBTA_GATTC_CLCB *p_clcb) // don't forget to clear the command queue before dealloc the clcb. list_clear(p_clcb->p_cmd_list); osi_free((void *)p_clcb->p_cmd_list); + p_clcb->p_cmd_list = NULL; //osi_free_and_reset((void **)&p_clcb->p_q_cmd); memset(p_clcb, 0, sizeof(tBTA_GATTC_CLCB)); } else {