Skip to content

Commit 4918524

Browse files
committed
Fix memory leak in timer management in port layer of Nimble.
1 parent ee430fe commit 4918524

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/libs/mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,10 @@ void
268268
npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq,
269269
ble_npl_event_fn *ev_cb, void *ev_arg)
270270
{
271+
if(co->handle == NULL) {
271272
memset(co, 0, sizeof(*co));
272273
co->handle = xTimerCreate("co", 1, pdFALSE, co, os_callout_timer_cb);
274+
}
273275
co->evq = evq;
274276
ble_npl_event_init(&co->ev, ev_cb, ev_arg);
275277
}

0 commit comments

Comments
 (0)