OSDN Git Service

Avoid double-free on SDP search failure
authorSrinu Jella <sjella@codeaurora.org>
Tue, 29 Dec 2015 08:00:19 +0000 (13:30 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 4 Mar 2016 06:53:17 +0000 (06:53 +0000)
commit07f612cbc08364a622e6e02cdbb039b82586d82c
tree4cc5fffcac1838468bdf33d74ad8d8ad5b40b468
parentcd0199a20b48fcb191f3178a28a6a503e28b7685
Avoid double-free on SDP search failure

Use case: BT transfer fails in Doze mode.

Pre-condition:
1. Device is in Doze mode.
2. Device is in Active state.

Steps to reproduce:
1. On test device and support device, turn on Bluetooth and keep test device in Bluetooth on screen.
2. Put device in Doze mode:
adb shell dumpsys battery unplug
adb shell dumpsys deviceidle step
3. From support device send pair request to test device.
4. Pair two devices.
5. Put test device in Doze mode again.
6. Share one picture from support device to test device by Bluetooth.
7. Accept Bluetooth file transferring request.

Failure: From DUT, BT transfer is failed.

Root cause: Free buffer is called twice for the SDP search failure case.

Fix: Added null check for p_sdp_db to avoid freeing same buffer
     again on SDP search failure.

Change-Id: Ic7776e842c52418c2b0fb6d6479233d01c709dc2
bta/dm/bta_dm_act.c