Re: [PATCH] hw/misc/npcm7xx_clk: Don't leak string in npcm7xx_clk_sel_init()

2022-03-08 Thread Hao Wu
On Tue, Mar 8, 2022 at 10:09 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 3/8/22 07:03, Peter Maydell wrote: > > In npcm7xx_clk_sel_init() we allocate a string with g_strdup_printf(). > > Use g_autofree so we free it rather than leaking it. > > > > (Detected with the clang leak

Re: [PATCH] hw/misc/npcm7xx_clk: Don't leak string in npcm7xx_clk_sel_init()

2022-03-08 Thread Richard Henderson
On 3/8/22 07:03, Peter Maydell wrote: In npcm7xx_clk_sel_init() we allocate a string with g_strdup_printf(). Use g_autofree so we free it rather than leaking it. (Detected with the clang leak sanitizer.) Signed-off-by: Peter Maydell --- hw/misc/npcm7xx_clk.c | 4 ++-- 1 file changed, 2 inser

Re: [PATCH] hw/misc/npcm7xx_clk: Don't leak string in npcm7xx_clk_sel_init()

2022-03-08 Thread Philippe Mathieu-Daudé
On 8/3/22 18:03, Peter Maydell wrote: In npcm7xx_clk_sel_init() we allocate a string with g_strdup_printf(). Use g_autofree so we free it rather than leaking it. (Detected with the clang leak sanitizer.) Signed-off-by: Peter Maydell --- hw/misc/npcm7xx_clk.c | 4 ++-- 1 file changed, 2 inse

[PATCH] hw/misc/npcm7xx_clk: Don't leak string in npcm7xx_clk_sel_init()

2022-03-08 Thread Peter Maydell
In npcm7xx_clk_sel_init() we allocate a string with g_strdup_printf(). Use g_autofree so we free it rather than leaking it. (Detected with the clang leak sanitizer.) Signed-off-by: Peter Maydell --- hw/misc/npcm7xx_clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw