]> git.proxmox.com Git - qemu.git/commitdiff
hw/pc_sysfw: Fix memory leak
authorStefan Weil <sw@weilnetz.de>
Sat, 28 Apr 2012 02:20:20 +0000 (02:20 +0000)
committerStefan Weil <sw@weilnetz.de>
Thu, 3 May 2012 05:04:48 +0000 (07:04 +0200)
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 <sw@weilnetz.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
hw/pc_sysfw.c

index fafdf9b1c1be114f4febeab59536022cdb30bd98..f0d7c21b5cceafeb8e4850cacf259bf8e2b50b9a 100644 (file)
@@ -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;
     }