Mesa (mesa_7_6_branch): progs/util: Fix memory leak if fopen fails in RawImageOpen.

Vinson Lee vlee at kemper.freedesktop.org
Fri Dec 4 01:03:47 UTC 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 305d4f147ea86d87706dbaf2caad6a131c59fe80
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=305d4f147ea86d87706dbaf2caad6a131c59fe80

Author: Vinson Lee <vlee at vmware.com>
Date:   Tue Nov 17 13:49:31 2009 -0800

progs/util: Fix memory leak if fopen fails in RawImageOpen.
(cherry picked from commit d9508e8df9da4aa13bc223194c406081738bac91)

---

 progs/util/readtex.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/progs/util/readtex.c b/progs/util/readtex.c
index c57b66b..3922998 100644
--- a/progs/util/readtex.c
+++ b/progs/util/readtex.c
@@ -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;
       }
    }




More information about the mesa-commit mailing list