diff options
author | Jean-François Milants <jf@codingfield.com> | 2021-02-07 18:09:19 +0100 |
---|---|---|
committer | Jean-François Milants <jf@codingfield.com> | 2021-02-07 18:09:19 +0100 |
commit | 4918524550346d702ba2e5a27cefd0e8bf976db1 (patch) | |
tree | d87b707856f1a26b24d4fc7de11ee5c0fe7c2a56 /src/libs/mynewt-nimble/porting/npl/freertos/src | |
parent | ee430fe5a997060eef7295bedc181006e0d1d13d (diff) |
Fix memory leak in timer management in port layer of Nimble.
Diffstat (limited to 'src/libs/mynewt-nimble/porting/npl/freertos/src')
-rw-r--r-- | src/libs/mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c b/src/libs/mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c index 87936bd8..875521ab 100644 --- a/src/libs/mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c +++ b/src/libs/mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c @@ -268,8 +268,10 @@ void npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq, ble_npl_event_fn *ev_cb, void *ev_arg) { + if(co->handle == NULL) { memset(co, 0, sizeof(*co)); co->handle = xTimerCreate("co", 1, pdFALSE, co, os_callout_timer_cb); + } co->evq = evq; ble_npl_event_init(&co->ev, ev_cb, ev_arg); } |