[flashrom] [PATCH] CID1130008: Resource leak

Stefan Reinauer stefan.reinauer at coreboot.org
Tue Nov 19 20:35:57 CET 2013


CID1130008: Resource leak

The system resource will not be reclaimed and reused, reducing the future
availability of the resource.
In read_romlayout: Leak of memory or pointers to system resources

Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>

Index: layout.c
===================================================================
--- layout.c	(revision 1763)
+++ layout.c	(working copy)
@@ -65,6 +65,7 @@
 		if (num_rom_entries >= MAX_ROMLAYOUT) {
 			msg_gerr("Maximum number of ROM images (%i) in layout "
 				 "file reached.\n", MAX_ROMLAYOUT);
+			fclose(romlayout);
 			return 1;
 		}
 		if (2 != fscanf(romlayout, "%s %s\n", tempstr, rom_entries[num_rom_entries].name))




More information about the flashrom mailing list