Author: stefanct Date: Sun Sep 23 00:56:09 2012 New Revision: 1603 URL: http://flashrom.org/trac/flashrom/changeset/1603
Log: 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
Modified: trunk/dummyflasher.c
Modified: trunk/dummyflasher.c ============================================================================== --- trunk/dummyflasher.c Sat Sep 22 03:38:06 2012 (r1602) +++ trunk/dummyflasher.c Sun Sep 23 00:56:09 2012 (r1603) @@ -150,8 +150,9 @@ 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); }