CID1130008: Resource leak read_romlayout()
Corresponding to flashrom svn r1773.
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
diff --git a/layout.c b/layout.c
index 08cc776..0e49f19 100644
--- a/layout.c
+++ b/layout.c
@@ -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))