Files
freeswitch/tests
Andrey Volk 815bbf8cfa [Core] Stop partner uuid lookups from growing the session pool, with a unit-test (#3311)
switch_channel_get_partner_uuid_copy() read signal_bond and originate_signal_bond with dup set, so every call
copied the uuid into the session pool before copying it into the caller's buffer. The read path calls it for
each comfort-noise frame of a bridged leg, so the pool grew by 40 bytes per frame until hangup. The lookups now
return the channel's own value, which stays valid under profile_mutex while it is copied.

The copy used strncpy(), which leaves the buffer without a terminating NUL when the value is as long as the
buffer or longer. switch_copy_string() cuts the value to fit and always terminates it.

With RTCP passthru, every received RTCP packet looked the partner up with switch_channel_get_partner_uuid(), which
copies the uuid into the session pool, so the pool grew with each packet until hangup. The lookup now copies the
uuid into a stack buffer with switch_channel_get_partner_uuid_copy().
2026-11-26 15:50:36 +03:00
..