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

Commit 7e9656ac authored by Nitin Arora's avatar Nitin Arora Committed by Andre Eisenbach
Browse files

Avoid double memory free and crash during LE discovery or disconnect

1. Prevent GATT operations to proceed if queue is not empty

This change returns a FALSE from GATT enqueue operation, in case
there is already a GATT command enqueued. This simple change will
a. Prevent incorrect memory freeing of the currently queued command.
b. Prevent incorrect dequeing of the ongoing command and enqueing
another command which will never be executed.
c. Double free of memory causing segmentation fault

2. Prevent performing pending operations when link is down

This change prevents performing the execution of pending operations
when the link is disconnected. The pending operation in that case
is bound to fail thus freeing the memory pointed to by the p_q_cmd
which is cleaned up again by the discovery completion routine and
thus causing double free.

Bug:24178843
Change-Id: Ief2756f289a7db73d251ef7e247774dd3f7fc413
parent df5eb969
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment