progs/util: Fix memory leak if fopen fails in RawImageOpen.
authorVinson Lee <vlee@vmware.com>
Tue, 17 Nov 2009 21:49:31 +0000 (13:49 -0800)
committerVinson Lee <vlee@vmware.com>
Fri, 4 Dec 2009 01:03:26 +0000 (17:03 -0800)
(cherry picked from commit d9508e8df9da4aa13bc223194c406081738bac91)

progs/util/readtex.c

index c57b66bd9d3bada8bdc62445df9ee2ee814dc4d9..3922998fd5bc4040ede90734c687e3e7cbc2e985 100644 (file)
@@ -109,6 +109,7 @@ static rawImageRec *RawImageOpen(const char *fileName)
          raw->file = fopen(baseName + 1, "rb");
       if(raw->file == NULL) {
          perror(fileName);
+         free(raw);
          return NULL;
       }
    }