Module: kamailio
Branch: master
Commit: acf50d86b502af36e3635d61745feaa5c577231d
URL:
https://github.com/kamailio/kamailio/commit/acf50d86b502af36e3635d61745feaa…
Author: Dennis Yurasov <dennis-y(a)yandex-team.ru>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-18T13:31:26+02:00
tcpops: fix memory leak in $tcp(conid)
- reference counter to tcp session not decremented, so shm for session never free
---
Modified: src/modules/tcpops/tcpops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/acf50d86b502af36e3635d61745feaa…
Patch:
https://github.com/kamailio/kamailio/commit/acf50d86b502af36e3635d61745feaa…
---
diff --git a/src/modules/tcpops/tcpops_mod.c b/src/modules/tcpops/tcpops_mod.c
index 6b648230894..a89a18992aa 100644
--- a/src/modules/tcpops/tcpops_mod.c
+++ b/src/modules/tcpops/tcpops_mod.c
@@ -811,6 +811,9 @@ static int pv_get_tcp(sip_msg_t *msg, pv_param_t *param, pv_value_t
*res)
tcpconn_put(con);
return pv_get_sintval(msg, param, res, ival);
default: /* conid */
+ if(con) {
+ tcpconn_put(con);
+ }
return pv_get_sintval(msg, param, res, msg->rcv.proto_reserved1);
}
}