Mesa (mesa_7_6_branch): progs/samples: Fix memory leak if malloc fails in rgbtoppm.c.

Vinson Lee vlee at kemper.freedesktop.org
Sat Dec 5 01:44:37 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sat Dec  5 01:43:29 2009 -0800

progs/samples: Fix memory leak if malloc fails in rgbtoppm.c.

---

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

diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c
index 6652bb3..56ca5b0 100644
--- a/progs/samples/rgbtoppm.c
+++ b/progs/samples/rgbtoppm.c
@@ -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;



More information about the mesa-commit mailing list