[PATCH] rtp-send: fix a memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



p is the return value of pa_sdp_build(), and pa_sdp_build() allocates
the return value with pa_sprintf_malloc(), so p has to be freed after
use.
---
 src/modules/rtp/module-rtp-send.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index ceb6df502..344463d58 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.c
@@ -492,6 +492,7 @@ int pa__init(pa_module*m) {
 
     pa_log_info("RTP stream initialized with mtu %u on %s:%u from %s ttl=%u, SSRC=0x%08x, payload=%u, initial sequence #%u", mtu, dst_addr, port, src_addr, ttl, u->rtp_context.ssrc, payload, u->rtp_context.sequence);
     pa_log_info("SDP-Data:\n%s\nEOF", p);
+    pa_xfree(p);
 
     pa_sap_send(&u->sap_context, 0);
 
-- 
2.17.0



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux