[flashrom] [PATCH 3/3] Fix memleak in the dummyflasher.
Stefan Tauner
stefan.tauner at student.tuwien.ac.at
Fri Sep 14 00:38:09 CEST 2012
emu_persistent_image was not freed correctly.
This bug was found thanks to valgrind.
Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
dummyflasher.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dummyflasher.c b/dummyflasher.c
index 2803f76..655b678 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -150,8 +150,9 @@ static int dummy_shutdown(void *data)
if (emu_chip != EMULATE_NONE) {
if (emu_persistent_image) {
msg_pdbg("Writing %s\n", emu_persistent_image);
- write_buf_to_file(flashchip_contents, emu_chip_size,
- emu_persistent_image);
+ write_buf_to_file(flashchip_contents, emu_chip_size, emu_persistent_image);
+ free(emu_persistent_image);
+ emu_persistent_image = NULL;
}
free(flashchip_contents);
}
--
Kind regards, Stefan Tauner
More information about the flashrom
mailing list