diff mbox

[3/3] hw/pc_sysfw: Fix memory leak

Message ID 1335615620-14081-4-git-send-email-sw@weilnetz.de
State Accepted
Headers show

Commit Message

Stefan Weil April 28, 2012, 12:20 p.m. UTC
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>
---
 hw/pc_sysfw.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Andreas Färber April 28, 2012, 1:13 p.m. UTC | #1
Am 28.04.2012 14:20, schrieb Stefan Weil:
> 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>

/-F
diff mbox

Patch

diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index fafdf9b..f0d7c21 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;
     }