PROVISORY: ambiorix: libamxrt: PCF-1080: fix memory leak in tr181-device

None-expired timers that are deleted stay in the list, normally removed
from memory as soon as SIGALRM happens.
Force garbage collection of deleted timers.

This fix is provided with libamxrt v0.5.2 but it has a lot of
dependencies. Let's backport the fix until libamxrt v0.5.2 gets merged.

Closes: PCF-1080
Signed-off-by: Yüce Kürüm <yuce.kurum@mind.be>
Signed-off-by: Yüce Kürüm <yuce.kurum_ext@softathome.com>
This commit is contained in:
Yüce Kürüm
2024-06-28 13:54:38 +02:00
committed by Petr Štetiar
parent 8ed52f8782
commit c86e5f136f

View File

@@ -0,0 +1,20 @@
Index: libamxrt-v0.3.6/src/amxrt_el_libevent.c
===================================================================
--- libamxrt-v0.3.6.orig/src/amxrt_el_libevent.c
+++ libamxrt-v0.3.6/src/amxrt_el_libevent.c
@@ -114,6 +114,7 @@ static void amxrt_el_connection_read_cb(
void* arg) {
amxp_connection_t* con = (amxp_connection_t*) arg;
con->reader(fd, con->priv);
+ amxp_timers_check();
}
static void amxrt_el_connection_can_write_cb(UNUSED evutil_socket_t fd,
@@ -135,6 +136,7 @@ static void amxrt_el_amxp_signal_read_cb
UNUSED short flags,
UNUSED void* arg) {
amxp_signal_read();
+ amxp_timers_check();
}
static void amxrt_el_amxp_syssignal_read_cb(UNUSED evutil_socket_t fd,