From 5023e30a33f27a5b2b61a57dc073f6e261579996 Mon Sep 17 00:00:00 2001 From: Tian Hao Date: Wed, 15 Feb 2017 20:08:39 +0800 Subject: [PATCH] component/bt : fix gatt write memory leak --- components/bt/bluedroid/stack/gatt/gatt_sr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/bt/bluedroid/stack/gatt/gatt_sr.c b/components/bt/bluedroid/stack/gatt/gatt_sr.c index 793ac1a9b0..2d34a05045 100644 --- a/components/bt/bluedroid/stack/gatt/gatt_sr.c +++ b/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 {