[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 5/6] sam460ex: Correct use after free error
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 5/6] sam460ex: Correct use after free error |
Date: |
Mon, 16 Jul 2018 18:38:08 +1000 |
From: BALATON Zoltan <address@hidden>
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 <address@hidden>
Signed-off-by: BALATON Zoltan <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/sam460ex.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index e2b7028843..0999efcc1e 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -269,11 +269,12 @@ static int sam460ex_load_device_tree(hwaddr addr,
exit(1);
}
fdt = load_device_tree(filename, &fdt_size);
- g_free(filename);
if (!fdt) {
error_report("Couldn't load dtb file `%s'", filename);
+ g_free(filename);
exit(1);
}
+ g_free(filename);
/* Manipulate device tree in memory. */
--
2.17.1
- [Qemu-ppc] [PULL 0/6] ppc-for-3.0 queue 20180716, David Gibson, 2018/07/16
- [Qemu-ppc] [PULL 2/6] spapr: Correct inverted test in spapr_pc_dimm_node(), David Gibson, 2018/07/16
- [Qemu-ppc] [PULL 5/6] sam460ex: Correct use after free error,
David Gibson <=
- [Qemu-ppc] [PULL 6/6] sm501: Fix warning about unreachable code, David Gibson, 2018/07/16
- [Qemu-ppc] [PULL 1/6] sm501: Update screen on frame buffer address change, David Gibson, 2018/07/16
- [Qemu-ppc] [PULL 3/6] ppc/xics: fix ICP reset path, David Gibson, 2018/07/16
- [Qemu-ppc] [PULL 4/6] etsec: fix IRQ (un)masking, David Gibson, 2018/07/16
- Re: [Qemu-ppc] [PULL 0/6] ppc-for-3.0 queue 20180716, Peter Maydell, 2018/07/16