vlc | branch: master | Sergio Ammirata <[email protected]> | Tue Nov 27 
07:45:45 2018 -0500| [d22baf21918cd9186734668f31cb74cf5a92d3a5] | committer: 
Thomas Guillem

access_out: rist: fix mem leak

It occured when socket creation failed.

Signed-off-by: Thomas Guillem <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d22baf21918cd9186734668f31cb74cf5a92d3a5
---

 modules/access_output/rist.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/access_output/rist.c b/modules/access_output/rist.c
index de36a744c9..1e36b963c5 100644
--- a/modules/access_output/rist.c
+++ b/modules/access_output/rist.c
@@ -126,20 +126,25 @@ static struct rist_flow 
*rist_udp_transmitter(sout_access_out_t *p_access, char
     if (flow->fd_out < 0)
     {
         msg_Err( p_access, "cannot open output socket" );
-        return NULL;
+        goto fail;
     }
 
     flow->fd_rtcp = net_ConnectDgram(p_access, psz_dst_server, i_dst_port + 1, 
-1, IPPROTO_UDP );
     if (flow->fd_rtcp < 0)
     {
         msg_Err( p_access, "cannot open nack socket" );
-        return NULL;
+        goto fail;
     }
 
     populate_cname(flow->fd_rtcp, flow->cname);
     msg_Info(p_access, "our cname is %s", flow->cname);
 
     return flow;
+
+fail:
+    free(flow->buffer);
+    free(flow);
+    return NULL;
 }
 
 static void rist_retransmit(sout_access_out_t *p_access, struct rist_flow 
*flow, uint16_t seq)

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to