You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2019/12/18 08:44:18 UTC

[mynewt-nimble] 01/02: nimble/host: Fix cleaning conn when sync transfer enabled

This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 93506850393d7c2095e24b098bb4453835841432
Author: Ɓukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Tue Dec 17 17:04:15 2019 +0100

    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.
---
 nimble/host/src/ble_hs_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/nimble/host/src/ble_hs_atomic.c b/nimble/host/src/ble_hs_atomic.c
index 5d51fbe..f26ba7a 100644
--- a/nimble/host/src/ble_hs_atomic.c
+++ b/nimble/host/src/ble_hs_atomic.c
@@ -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);
 
     }