ppc/amigaone: Free allocated struct
PATCH 1/1 ppc/amigaone: Free allocated struct
In create_bd_info function a bd_info struct is allocated but never freed. Mark it g_autofree to avoid leaking it.
Fixes 34f053d86b (ppc/amigaone: Add kernel and initrd support)
Resolves: Coverity CID 1641398
Signed-off-by BALATON Zoltan <[email protected]>
--- hw/ppc/amigaone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/amigaone.c +1 -1
@@ -221,7 +221,7 @@ struct bd_info {static void create_bd_info (hwaddr addr,ram_addr_t ram_size) { - struct bd_info *bd = g_new0(struct bd_info, 1); + g_autofree struct bd_info *bd = g_new0(struct bd_info, 1); bd->bi_memsize =cpu_to_be32 (ram_size); bd->bi_flashstart =cpu_to_be32 (PROM_ADDR );
Signature · 1 line
2.41.3
Quoted 15 lines · BALATON Zoltan
In
create_bd_infofunction abd_infostruct is allocated but never freed. Mark itg_autofreeto avoid leaking it.Fixes 34f053d86b (ppc/amigaone: Add kernel and initrd support)Resolves: Coverity CID 1641398
Signed-off-by BALATON Zoltan <[email protected]>--- hw/ppc/amigaone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/amigaone.c +0
-0
hw/ppc/amigaone.c struct bd_info { · line 225
Quoted 6 lines
hw/ppc/amigaone.c +1
-1@@ -221,7 +221,7 @@ struct bd_info {static void create_bd_info (hwaddr addr,ram_addr_t ram_size) { - struct bd_info *bd = g_new0(struct bd_info, 1); + g_autofree struct bd_info *bd = g_new0(struct bd_info, 1);
Reviewed-by Harsh Prateek Bora <[email protected]>
Quoted 2 lines
hw/ppc/amigaone.c +0
-0bd->bi_memsize =cpu_to_be32 (ram_size); bd->bi_flashstart =cpu_to_be32 (PROM_ADDR );