Fix memory leak in timer management in port layer of Nimble.

This commit is contained in:
Jean-François Milants 2021-02-07 18:09:19 +01:00
parent ee430fe5a9
commit 4918524550

View file

@ -268,8 +268,10 @@ void
npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq, npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq,
ble_npl_event_fn *ev_cb, void *ev_arg) ble_npl_event_fn *ev_cb, void *ev_arg)
{ {
if(co->handle == NULL) {
memset(co, 0, sizeof(*co)); memset(co, 0, sizeof(*co));
co->handle = xTimerCreate("co", 1, pdFALSE, co, os_callout_timer_cb); co->handle = xTimerCreate("co", 1, pdFALSE, co, os_callout_timer_cb);
}
co->evq = evq; co->evq = evq;
ble_npl_event_init(&co->ev, ev_cb, ev_arg); ble_npl_event_init(&co->ev, ev_cb, ev_arg);
} }