summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
Diffstat (limited to 'progs')
-rw-r--r--progs/redbook/convolution.c1
-rw-r--r--progs/redbook/histogram.c1
-rw-r--r--progs/redbook/minmax.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/progs/redbook/convolution.c b/progs/redbook/convolution.c
index 0543379f24..0898ef25e1 100644
--- a/progs/redbook/convolution.c
+++ b/progs/redbook/convolution.c
@@ -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;
}
diff --git a/progs/redbook/histogram.c b/progs/redbook/histogram.c
index de1e59edea..70a5282577 100644
--- a/progs/redbook/histogram.c
+++ b/progs/redbook/histogram.c
@@ -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;
}
diff --git a/progs/redbook/minmax.c b/progs/redbook/minmax.c
index da5b875a47..8281800ba4 100644
--- a/progs/redbook/minmax.c
+++ b/progs/redbook/minmax.c
@@ -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;
}