mtd/util mkfs.jffs2.c,1.49,1.50

David Woodhouse dwmw2 at infradead.org
Wed Jan 11 11:22:07 EST 2006


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv2885

Modified Files:
	mkfs.jffs2.c 
Log Message:
Fix cbuf free properly.
Noted by Dan Berrange.


Index: mkfs.jffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- mkfs.jffs2.c	10 Jan 2006 19:14:39 -0000	1.49
+++ mkfs.jffs2.c	11 Jan 2006 16:22:04 -0000	1.50
@@ -862,12 +862,14 @@
 			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)) {





More information about the linux-mtd-cvs mailing list