On Wed, 2 Mar 2022 at 08:33, Cédric Le Goater <c...@kaod.org> wrote: > > From: Wentao_Liang <wentao_lian...@163.com> > > A memory chunk is allocated with g_new0() and assigned to the variable > 'storage'. However, if the branch takes true, there will be only an > error report but not a free operation for 'storage' before function > returns. As a result, a memory leak bug is triggered. > > Use g_autofree to fix the issue. > > Suggested-by: Philippe Mathieu-Daudé <f4...@amsat.org> > Signed-off-by: Wentao_Liang <wentao_lian...@163.com> > [ clg: reworked the commit log ] > Signed-off-by: Cédric Le Goater <c...@kaod.org>
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM