]> granicus.if.org Git - esp-idf/commitdiff
component/bt : fix gatt write memory leak
authorTian Hao <tianhao@espressif.com>
Wed, 15 Feb 2017 12:08:39 +0000 (20:08 +0800)
committerTian Hao <tianhao@espressif.com>
Wed, 15 Feb 2017 12:08:39 +0000 (20:08 +0800)
components/bt/bluedroid/stack/gatt/gatt_sr.c

index 793ac1a9b0556a231170a0c745f453e1f6b68e37..2d34a05045caafd812b4740e2021098830c8e62f 100644 (file)
@@ -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 {