mtd/fs/jffs2 readinode.c,1.105,1.106

David Woodhouse dwmw2 at infradead.org
Wed May 14 02:53:29 EDT 2003


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv4921

Modified Files:
	readinode.c 
Log Message:
Fix memory leak found by Stanford checker and/or Hollis Blanchard


Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- readinode.c	11 Mar 2003 18:45:14 -0000	1.105
+++ readinode.c	14 May 2003 06:53:26 -0000	1.106
@@ -169,8 +169,10 @@
 		if (lastend < newfrag->node->ofs) {
 			/* ... and we need to put a hole in before the new node */
 			struct jffs2_node_frag *holefrag = jffs2_alloc_node_frag();
-			if (!holefrag)
+			if (!holefrag) {
+				jffs2_free_node_frag(newfrag);
 				return -ENOMEM;
+			}
 			holefrag->ofs = lastend;
 			holefrag->size = newfrag->node->ofs - lastend;
 			holefrag->node = NULL;




More information about the linux-mtd-cvs mailing list