projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6212c81
)
progs/samples: Fix memory leak if fopen fails in rgbtoppm.c.
author
Vinson Lee
<vlee@vmware.com>
Sat, 5 Dec 2009 09:38:14 +0000
(
01:38
-0800)
committer
Vinson Lee
<vlee@vmware.com>
Sat, 5 Dec 2009 09:38:14 +0000
(
01:38
-0800)
progs/samples/rgbtoppm.c
patch
|
blob
|
history
diff --git
a/progs/samples/rgbtoppm.c
b/progs/samples/rgbtoppm.c
index 116d9a8cfa5b64eb825a4d4c3e603f4101f7affd..6652bb32ec1e9dfbf9bd7abc819d082c61c99086 100644
(file)
--- 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);