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 6652bb3..56ca5b0 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;