hw/display/tcx.c: Fix memory leak

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Shannon Zhao 2015-05-28 19:13:45 +08:00 committed by Michael Tokarev
parent 22b2aeb82c
commit 8684e85ca9

View File

@ -1018,6 +1018,7 @@ static void tcx_realizefn(DeviceState *dev, Error **errp)
if (fcode_filename) {
ret = load_image_targphys(fcode_filename, s->prom_addr,
FCODE_MAX_ROM_SIZE);
g_free(fcode_filename);
if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
error_report("tcx: could not load prom '%s'", TCX_ROM_FILE);
}