From cbcbd32c1e62235877288bc0e0b54aad400a305f Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Thu, 15 Jan 2015 00:18:14 -0500 Subject: [PATCH] rtp: jpeg: fix memory leaks --- 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 cf8635bdd9..d8c86211da 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 */ -- 2.39.2