diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2012-09-22 22:56:09 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2012-09-22 22:56:09 +0000 |
commit | dd75e7651000321a753539c364ee74ce0e3c5b28 (patch) | |
tree | 71c48f27dadf37c78b9e9da5defba243ea3a2be3 /dummyflasher.c | |
parent | 94a563a6256c8be8b5bba65ce17796f9d2bee0d0 (diff) | |
download | flashrom-dd75e7651000321a753539c364ee74ce0e3c5b28.tar.gz |
Fix a memleak in the dummyflasher.
emu_persistent_image was not freed correctly.
This bug was found thanks to valgrind.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1603 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'dummyflasher.c')
-rw-r--r-- | dummyflasher.c | 5 |
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); } |