OSDN Git Service

Fix crash during derigister GATT server
authorChao Quan <chao.quan@mediatek.com>
Mon, 24 Jul 2017 11:46:53 +0000 (19:46 +0800)
committerJakub Pawlowski <jpawlowski@google.com>
Mon, 11 Sep 2017 15:34:13 +0000 (15:34 +0000)
commita5aca8f6de825252b5bb72f5d1d8ff7dd1b5247a
treedf5db6351977be1610059b98c3bc8a4231f48e31
parent5b96667c28d868a3c93edec0b9d7242532fcfb78
Fix crash during derigister GATT server

When deregister a gatt server, GATT_deregister
will use a loop to stop service one by one and
call std::list::erase in GATTS_StopService to
remove service info. But erase makes iterator lose
efficacy. If the iterator is operated after that,
Bluetooth will crash.

Add the iterator before erase.

Test: manual
Change-Id: I10f9351a95ab4922553d8a77663a0212407607aa
stack/gatt/gatt_api.cc