]> git.sesse.net Git - vlc/commitdiff
rtp: jpeg: fix memory leaks
authorTristan Matthews <tmatth@videolan.org>
Thu, 15 Jan 2015 05:18:14 +0000 (00:18 -0500)
committerTristan Matthews <tmatth@videolan.org>
Thu, 15 Jan 2015 05:18:14 +0000 (00:18 -0500)
modules/stream_out/rtpfmt.c

index cf8635bdd95fbf7180cf5b73e094a66dd1ffa4f2..d8c86211dabeb54bdefd440519ce32894f2e0e20 100644 (file)
@@ -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 */