فهرست منبع

Merge branch 'bugfix/btdm_gatt' into 'master'

component/bt : fix gatt write memory leak

fix bug of GATT write cause memory leak

See merge request !506

Jiang Jiang Jian 9 سال پیش
والد
کامیت
61c7bd3c3a
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      components/bt/bluedroid/stack/gatt/gatt_sr.c

+ 3 - 1
components/bt/bluedroid/stack/gatt/gatt_sr.c

@@ -1073,9 +1073,11 @@ void gatts_process_write_req (tGATT_TCB *p_tcb, UINT8 i_rcb, UINT16 handle,
                     GATTS_REQ_TYPE_WRITE,
                     &sr_data);
 
-            if(status == GATT_SUCCESS){
+            if (status == GATT_SUCCESS) {
                 attp_send_sr_msg(p_tcb, p_msg);
                 gatt_dequeue_sr_cmd(p_tcb);
+            } else {
+                GKI_freebuf(p_msg);
             }
 
         } else {