sam460ex: Correct use after free error
Commit 51b0d834c changed error handling to report file name in error message but forgot to move freeing it after usage. Noticed by Coverity. Fixes: CID 1394217 Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
fd8e3381a0
commit
3cc702d6aa
@ -269,11 +269,12 @@ static int sam460ex_load_device_tree(hwaddr addr,
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
fdt = load_device_tree(filename, &fdt_size);
|
fdt = load_device_tree(filename, &fdt_size);
|
||||||
g_free(filename);
|
|
||||||
if (!fdt) {
|
if (!fdt) {
|
||||||
error_report("Couldn't load dtb file `%s'", filename);
|
error_report("Couldn't load dtb file `%s'", filename);
|
||||||
|
g_free(filename);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
g_free(filename);
|
||||||
|
|
||||||
/* Manipulate device tree in memory. */
|
/* Manipulate device tree in memory. */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user