Browse Source

progs/redbook: Fix memory leaks on error paths.

tags/7.8-rc1
Vinson Lee 15 years ago
parent
commit
7eaf33ad03
3 changed files with 3 additions and 0 deletions
  1. 1
    0
      progs/redbook/convolution.c
  2. 1
    0
      progs/redbook/histogram.c
  3. 1
    0
      progs/redbook/minmax.c

+ 1
- 0
progs/redbook/convolution.c View File

@@ -97,6 +97,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height )
pixels = (GLubyte *) malloc( n * sizeof( GLubyte ));
if ( !pixels ) {
fprintf( stderr, "Unable to malloc() bytes for pixels\n" );
fclose( infile );
return NULL;
}


+ 1
- 0
progs/redbook/histogram.c View File

@@ -102,6 +102,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height )
pixels = (GLubyte *) malloc( n * sizeof( GLubyte ));
if ( !pixels ) {
fprintf( stderr, "Unable to malloc() bytes for pixels\n" );
fclose( infile );
return NULL;
}


+ 1
- 0
progs/redbook/minmax.c View File

@@ -97,6 +97,7 @@ readImage( const char* filename, GLsizei* width, GLsizei *height )
pixels = (GLubyte *) malloc( n * sizeof( GLubyte ));
if ( !pixels ) {
fprintf( stderr, "Unable to malloc() bytes for pixels\n" );
fclose( infile );
return NULL;
}


Loading…
Cancel
Save