rtp-send: fix a memory leak

Submitted by Tanu Kaskinen on May 4, 2018, 2:22 p.m.

Details

Message ID 20180504142258.7973-1-tanuk@iki.fi
State New
Series "rtp-send: fix a memory leak"
Headers show

Commit Message

Tanu Kaskinen May 4, 2018, 2:22 p.m.
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(+)

Patch hide | download patch | download mbox

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);