Blob Blame History Raw
 src/ucil_png.c    |    1 +
 src/ucil_rawavi.c |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/ucil_png.c b/src/ucil_png.c
index 9fd9de3..2406ce7 100644
--- a/src/ucil_png.c
+++ b/src/ucil_png.c
@@ -286,6 +286,7 @@ unicap_status_t ucil_load_png( char *filename, unicap_data_buffer_t *buffer )
    if( !check_if_png( filename, &f ) )
    {
       TRACE( "File '%s' is not a valid PNG image\n", filename );
+      fclose( f );
       return STATUS_FAILURE;
    }
    
diff --git a/src/ucil_rawavi.c b/src/ucil_rawavi.c
index d578922..8b6f7b4 100644
--- a/src/ucil_rawavi.c
+++ b/src/ucil_rawavi.c
@@ -225,6 +225,7 @@ static void avi_list_pad( avi_buffer_t *list, int offset, int padding )
    padsize = padding - ( ( offset + list->dwPtr + sizeof( avi_list_t ) - 4 ) % padding );
    
    avi_add_chunk( list, UCIL_FOURCC( 'J', 'U', 'N', 'K' ), padsize, chunk_buffer );
+   free( chunk_buffer );
 }
 
 
@@ -573,6 +574,7 @@ static avi_buffer_t *ucil_rawavi_create_index( ucil_rawavi_video_file_object_t *
    avi_index_entry_t *idx;
    int i;
    int offset = 4;
+   avi_buffer_t *buf;
    
    idx = malloc( vobj->movi_frames * sizeof( avi_index_entry_t ) );
 
@@ -586,7 +588,9 @@ static avi_buffer_t *ucil_rawavi_create_index( ucil_rawavi_video_file_object_t *
       offset += vobj->format.buffer_size + 8;
    }
    
-   return avi_create_chunk( UCIL_FOURCC( 'i', 'd', 'x', '1' ), idx, vobj->movi_frames * sizeof( avi_index_entry_t ) );   
+   buf = avi_create_chunk( UCIL_FOURCC( 'i', 'd', 'x', '1' ), idx, vobj->movi_frames * sizeof( avi_index_entry_t ) );   
+   free( idx );
+   return buf;
 }
 
 unicap_status_t ucil_rawavi_close_video_file( ucil_rawavi_video_file_object_t *vobj )