diff mbox

[v2,1/4] hw/display/cg3.c: Fix memory leak

Message ID 1432816784-12436-2-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

Shannon Zhao May 28, 2015, 12:39 p.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 hw/display/cg3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 1e6ff2b..186d544 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -303,8 +303,9 @@  static void cg3_realizefn(DeviceState *dev, Error **errp)
         ret = load_image_targphys(fcode_filename, s->prom_addr,
                                   FCODE_MAX_ROM_SIZE);
         if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
-            error_report("cg3: could not load prom '%s'", CG3_ROM_FILE);
+            error_report("cg3: could not load prom '%s'", fcode_filename);
         }
+        g_free(fcode_filename);
     }
 
     memory_region_init_ram(&s->vram_mem, NULL, "cg3.vram", s->vram_size,