]> granicus.if.org Git - esp-idf/commitdiff
component/bt: reset the p_cmd_list pointer after release the mem.
authoryulong <huangyulong@espressif.com>
Wed, 29 Nov 2017 02:50:03 +0000 (10:50 +0800)
committeryulong <huangyulong@espressif.com>
Wed, 29 Nov 2017 02:50:03 +0000 (10:50 +0800)
components/bt/bluedroid/bta/gatt/bta_gattc_utils.c

index 676ed851ac0abe63d521091d32a9e45549642ae8..70655fd94417648ed71578c3e468ffdeafa4a34d 100644 (file)
@@ -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 {