Module: Mesa Branch: mesa_7_6_branch Commit: 412aeeed1c392ab5796c85287fc6ebdccd74880c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=412aeeed1c392ab5796c85287fc6ebdccd74880c
Author: Vinson Lee <[email protected]> Date: Sat Dec 5 01:38:14 2009 -0800 progs/samples: Fix memory leak if fopen fails in rgbtoppm.c. --- progs/samples/rgbtoppm.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c index 116d9a8..6652bb3 100644 --- a/progs/samples/rgbtoppm.c +++ b/progs/samples/rgbtoppm.c @@ -86,7 +86,8 @@ static ImageRec *ImageOpen(char *fileName) exit(1); } if ((image->file = fopen(fileName, "rb")) == NULL) { - return NULL; + free(image); + return NULL; } fread(image, 1, 12, image->file); _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
