qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/6] coverity-model: make g_free a synonym of free


From: Peter Maydell
Subject: Re: [PATCH 2/6] coverity-model: make g_free a synonym of free
Date: Mon, 2 Aug 2021 13:32:24 +0100

On Sat, 31 Jul 2021 at 07:29, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Recently, Coverity has started complaining about using g_free() to free
> memory areas allocated by GLib functions not included in model.c,
> such as g_strfreev.  This unfortunately goes against the GLib
> documentation, which suggests that g_malloc() should be matched
> with g_free() and plain malloc() with free(); since GLib 2.46 however
> g_malloc() is hardcoded to always use the system malloc implementation,
> and g_free is just "free" plus a tracepoint.  Therefore, this
> should not cause any problem in practice.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

A bit sad to lose the distinction, but as you say the mismatch is now
guaranteed by glib to not be a bug, and in any case we already managed
to get most of the errors out of our codebase.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]