From 6e05a12f8f7f32a3fecbeb0c572d549a5f6e9177 Mon Sep 17 00:00:00 2001 From: Gonglei Date: Thu, 5 Mar 2015 10:58:32 +0800 Subject: arm: fix memory leak Cc: Michael Tokarev Cc: Peter Maydell Signed-off-by: Gonglei Signed-off-by: Michael Tokarev --- hw/arm/virt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/arm/virt.c') diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9072bc2..b2eaea8 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -552,7 +552,7 @@ static void create_flash(const VirtBoardInfo *vbi) char *nodename; if (bios_name) { - const char *fn; + char *fn; if (drive_get(IF_PFLASH, 0, 0)) { error_report("The contents of the first flash device may be " @@ -565,6 +565,7 @@ static void create_flash(const VirtBoardInfo *vbi) error_report("Could not load ROM image '%s'", bios_name); exit(1); } + g_free(fn); } create_one_flash("virt.flash0", flashbase, flashsize); -- cgit v1.1