progs/samples: Fix memory leak if malloc fails in rgbtoppm.c.
authorVinson Lee <vlee@vmware.com>
Sat, 5 Dec 2009 09:43:29 +0000 (01:43 -0800)
committerVinson Lee <vlee@vmware.com>
Sat, 5 Dec 2009 09:43:29 +0000 (01:43 -0800)
progs/samples/rgbtoppm.c

index 6652bb32ec1e9dfbf9bd7abc819d082c61c99086..56ca5b0efe9e0e9753cab41a221ed2854d4df23c 100644 (file)
@@ -225,6 +225,7 @@ read_rgb_texture(char *name, int *width, int *height)
       if (gbuf) free(gbuf);
       if (bbuf) free(bbuf);
       if (abuf) free(abuf);
+      ImageClose(image); 
       return NULL;
     }
     ptr = base;