summaryrefslogtreecommitdiffstats
path: root/dummyflasher.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-09-22 22:56:09 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-09-22 22:56:09 +0000
commite0ff1652a60e3fdcd82e3def8c9d13b071a4d05d (patch)
tree71c48f27dadf37c78b9e9da5defba243ea3a2be3 /dummyflasher.c
parent5609f9d408645657ef0dd2ca986ada5aaad4c875 (diff)
downloadast2050-flashrom-e0ff1652a60e3fdcd82e3def8c9d13b071a4d05d.zip
ast2050-flashrom-e0ff1652a60e3fdcd82e3def8c9d13b071a4d05d.tar.gz
Fix a memleak in the dummyflasher
Emu_persistent_image was not freed correctly. This bug was found thanks to valgrind. Corresponding to flashrom svn r1603. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'dummyflasher.c')
-rw-r--r--dummyflasher.c5
1 files 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);
}
OpenPOWER on IntegriCloud