[vlc-commits] rtp: jpeg: fix memory leaks

Tristan Matthews git at videolan.org
Thu Jan 15 06:30:09 CET 2015


vlc | branch: master | Tristan Matthews <tmatth at videolan.org> | Thu Jan 15 00:18:14 2015 -0500| [cbcbd32c1e62235877288bc0e0b54aad400a305f] | committer: Tristan Matthews

rtp: jpeg: fix memory leaks

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

 modules/stream_out/rtpfmt.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
index cf8635b..d8c8621 100644
--- a/modules/stream_out/rtpfmt.c
+++ b/modules/stream_out/rtpfmt.c
@@ -1626,11 +1626,14 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
 
         int i_payload = __MIN( i_data, (int)(rtp_mtu (id) - hdr_size) );
         if ( i_payload <= 0 )
-            return VLC_EGENERIC;
+            goto error;
 
         block_t *out = block_Alloc( 12 + hdr_size + i_payload );
         if( out == NULL )
+        {
+            block_Release( in );
             return VLC_ENOMEM;
+        }
 
         uint8_t *p = out->p_buffer + 12;
         /* set main header */



More information about the vlc-commits mailing list