aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-04-11 20:32:47 -0500
committerJosh Boyer <jwboyer@gmail.com>2006-04-11 20:32:47 -0500
commit77a840b7e2e6a432299ccdb98031db56471d7848 (patch)
tree8ab4fab5b2c858965a2a39de17eb624c6fda5cb4
parent3db28b81fc01c94979e1ba2684bd82190cce71b1 (diff)
Fix cbuf free properly.
Noted by Dan Berrange. Signed-off-by: Josh Boyer <jwboyer@gmail.com>
-rw-r--r--mkfs.jffs2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
index 8d1c7a5..a708f14 100644
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
@@ -862,12 +862,15 @@ static void write_regular_file(struct filesystem_entry *e)
full_write(out_fd, wbuf, space);
padword();
+ if (tbuf!= cbuf) {
+ free(cbuf);
+ cbuf = NULL;
+ }
+
tbuf += dsize;
len -= dsize;
offset += dsize;
- if (tbuf!= cbuf)
- free(cbuf);
}
}
if (!je32_to_cpu(ri.version)) {
@@ -1203,7 +1206,7 @@ static char *helptext =
" -V, --version Display version information\n"
" -i, --incremental=FILE Parse FILE and generate appendage output for it\n\n";
-static char *revtext = "$Revision: 1.49 $";
+static char *revtext = "$Revision: 1.50 $";
int load_next_block() {