Commit e17b696e authored by Marie Janssen's avatar Marie Janssen
Browse files

Fix memory leak in vendor layer

When the vendor library transmits without giving a callback, the vendor
translation receives a buffer it's in charge of deallocating.

When there is a callback, it's the vendor library's job to deallocate
it.

Change-Id: I65b0a037b28103ba46a33a1baea942f7e724eb7c
parent 581622f8
......@@ -166,8 +166,12 @@ static void buffer_free_cb(void *buffer) {
static void transmit_completed_callback(BT_HDR *response, void *context) {
// Call back to the vendor library if it provided a callback to call.
if (context)
if (context) {
((tINT_CMD_CBACK)context)(response);
} else {
// HCI layer expects us to release the response.
buffer_free_cb(response);
}
}
// Called back from vendor library when it wants to send an HCI command.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment