progs/util: Fix memory leak if LoadYUVImage fails.
authorVinson Lee <vlee@vmware.com>
Tue, 17 Nov 2009 02:22:26 +0000 (18:22 -0800)
committerVinson Lee <vlee@vmware.com>
Fri, 4 Dec 2009 00:03:22 +0000 (16:03 -0800)
(cherry picked from commit 0e790ac35327a0b53a4a595a6429135317302269)

progs/util/readtex.c

index 8e923b6eb47126952e9dd5cf2caa2b858bcc5d50..134eb79100abc0cb42da8dd703a2e80bedf6aa9b 100644 (file)
@@ -438,6 +438,7 @@ GLushort *LoadYUVImage( const char *imageFile, GLint *width, GLint *height )
       fprintf(stderr,
               "Error in LoadYUVImage %d-component images not implemented\n",
               image->components );
+      FreeImage(image);
       return NULL;
    }