summaryrefslogtreecommitdiffstats
path: root/progs/redbook/histogram.c
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-02-17 01:57:14 -0800
committerVinson Lee <vlee@vmware.com>2010-02-17 01:57:14 -0800
commit7eaf33ad0349e39dd6611b0b27aa44687e8c3014 (patch)
tree2a6033b33086f45713f18809043fc0c57ddfc824 /progs/redbook/histogram.c
parent41b19c279a0eae61f0f95c3b66376a25635241fd (diff)
downloadexternal_mesa3d-7eaf33ad0349e39dd6611b0b27aa44687e8c3014.zip
external_mesa3d-7eaf33ad0349e39dd6611b0b27aa44687e8c3014.tar.gz
external_mesa3d-7eaf33ad0349e39dd6611b0b27aa44687e8c3014.tar.bz2
progs/redbook: Fix memory leaks on error paths.
Diffstat (limited to 'progs/redbook/histogram.c')
-rw-r--r--progs/redbook/histogram.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/progs/redbook/histogram.c b/progs/redbook/histogram.c
index de1e59e..70a5282 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;
}