]> granicus.if.org Git - esp-idf/commitdiff
component/bt : fix GATT disconnect memory leak bug
authorTian Hao <tianhao@espressif.com>
Mon, 13 Feb 2017 06:00:26 +0000 (14:00 +0800)
committerTian Hao <tianhao@espressif.com>
Mon, 13 Feb 2017 06:00:26 +0000 (14:00 +0800)
components/bt/bluedroid/stack/gatt/gatt_sr.c

index a7ee3b5ad08c29ea7bfc22b5e7854de454d1b20f..793ac1a9b0556a231170a0c745f453e1f6b68e37 100644 (file)
@@ -1162,6 +1162,10 @@ static void gatts_process_read_req(tGATT_TCB *p_tcb, tGATT_SR_REG *p_rcb, UINT8
     } else if (reason == GATT_SUCCESS || reason == GATT_STACK_RSP) {
         attp_send_sr_msg(p_tcb, p_msg);
         gatt_dequeue_sr_cmd(p_tcb);
+    } else {
+        if (p_msg) {
+            GKI_freebuf(p_msg);
+        }
     }
 
 }