nimble/host: Fix cleaning conn when sync transfer enabled

When host is waiting for the sync transfer, conn->psync is allocated.
If ACL disconnection happen before sync is established, make sure to
free it.
This commit is contained in:
Łukasz Rymanowski
2019-12-18 09:44:10 +01:00
parent cfaa870532
commit 9350685039
+5
View File
@@ -28,6 +28,11 @@ ble_hs_atomic_conn_delete(uint16_t conn_handle)
conn = ble_hs_conn_find(conn_handle);
if (conn != NULL) {
ble_hs_conn_remove(conn);
#if MYNEWT_VAL(BLE_PERIODIC_ADV_SYNC_TRANSFER)
if (conn->psync) {
ble_hs_periodic_sync_free(conn->psync);
}
#endif
ble_hs_conn_free(conn);
}