qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH] Changed malloc() to g_malloc() at places wher


From: Peter Maydell
Subject: Re: [Qemu-trivial] [PATCH] Changed malloc() to g_malloc() at places where return value was not being checked
Date: Tue, 22 Mar 2016 16:46:53 +0000

On 22 March 2016 at 16:15, haris iqbal <address@hidden> wrote:
> One more question. About tracking down g_free(). I thought of
> submitting for linux-user/qemu.h first. As it is done in a function
> called lock_user(), which is called by many other functions (around
> 144, too many to be checked manually). The interesting part is, the
> free is done by a pair function called unlock_user(). I just want to
> ask if all those lock_user() calls has a matching unlock_user() call
> to free() the malloc(), or there is a hidden free somewhere else also?
> This would save a lot of time. Thanks.

lock_user and unlock_user should always match. (In particular
lock_user will only malloc if DEBUG_REMAP is defined, which it
is not by default, so callers can't be free()ing by mistake.)

thanks
-- PMM



reply via email to

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