]> git.sesse.net Git - vlc/commitdiff
demux: mp4: fix memleak on error
authorFrancois Cartegnie <fcvlcdev@free.fr>
Sat, 7 Mar 2015 18:00:59 +0000 (19:00 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Sat, 7 Mar 2015 18:00:59 +0000 (19:00 +0100)
modules/demux/mp4/mp4.c

index 21ad874cc3bc1121520524bcd2d7f0388a0ad732..09666fba514b089d3c8eab4ade9de9a6c9400bcd 100644 (file)
@@ -3632,7 +3632,11 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
     ret->p_sample_delta_dts = calloc( ret->i_sample_count, sizeof( uint32_t ) );
 
     if( !ret->p_sample_count_dts || !ret->p_sample_delta_dts )
+    {
+        free( ret->p_sample_count_dts );
+        free( ret->p_sample_delta_dts );
         return VLC_ENOMEM;
+    }
 
     ret->p_sample_count_pts = calloc( ret->i_sample_count, sizeof( uint32_t ) );
     if( !ret->p_sample_count_pts )