From: Stefan Weil Date: Sat, 28 Apr 2012 02:20:20 +0000 (+0000) Subject: hw/pc_sysfw: Fix memory leak X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9cf1f002d7761a1938066379d54a67e8f8b48cc2;p=qemu.git hw/pc_sysfw: Fix memory leak Valgrind reported this memory leak which occured a few times. Test scenario: qemu-system-i386 (no arguments), only BIOS started, terminate with monitor command (quit). Signed-off-by: Stefan Weil Reviewed-by: Andreas Färber --- diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index fafdf9b1c1..f0d7c21b5c 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -85,6 +85,9 @@ static void pc_fw_add_pflash_drv(void) filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); opts = drive_add(IF_PFLASH, -1, filename, "readonly=on"); + + g_free(filename); + if (opts == NULL) { return; }