[vlc-commits] scaletempo: Fix leak on error

Hugo Beauzée-Luyssen git at videolan.org
Tue Jul 31 14:13:01 CEST 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jul 31 14:11:58 2018 +0200| [2a3e036fb221a8cb96817d6b05d6deba70ac0743] | committer: Hugo Beauzée-Luyssen

scaletempo: Fix leak on error

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

 modules/audio_filter/scaletempo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/audio_filter/scaletempo.c b/modules/audio_filter/scaletempo.c
index 36a33ae09e..5fdc4317c5 100644
--- a/modules/audio_filter/scaletempo.c
+++ b/modules/audio_filter/scaletempo.c
@@ -579,7 +579,10 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
     size_t i_outsize = calculate_output_buffer_size ( p_filter, p_in_buf->i_buffer );
     block_t *p_out_buf = block_Alloc( i_outsize );
     if( p_out_buf == NULL )
+    {
+        block_Release( p_in_buf );
         return NULL;
+    }
 
     size_t bytes_out = transform_buffer( p_filter,
         p_in_buf->p_buffer, p_in_buf->i_buffer,



More information about the vlc-commits mailing list