changeset 20155:c903e0d80f02

More possible memleaks.
author reimar
date Wed, 11 Oct 2006 15:57:51 +0000
parents 2e7baee989ad
children 42b46a42f83b
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Wed Oct 11 15:47:37 2006 +0000
+++ b/libmpdemux/demux_mkv.c	Wed Oct 11 15:57:51 2006 +0000
@@ -3538,10 +3538,14 @@
 
                 case MATROSKA_ID_BLOCK:
                   block_length = ebml_read_length (s, &tmp);
+                  free(block);
                   block = malloc (block_length);
                   demuxer->filepos = stream_tell (s);
                   if (stream_read (s,block,block_length) != (int) block_length)
+                  {
+                    free(block);
                     return 0;
+                  }
                   l = tmp + block_length;
                   break;
 
@@ -3609,7 +3613,10 @@
                     block = malloc (block_length);
                     demuxer->filepos = stream_tell (s);
                     if (stream_read (s,block,block_length) != (int) block_length)
+                    {
+                      free(block);
                       return 0;
+                    }
                     l = tmp + block_length;
                     res = handle_block (demuxer, block, block_length,
                                         block_duration, block_bref, block_fref, 1);