Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91010f2e 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 72550d3c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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.