On Tue, Mar 22, 2016 at 10:16 PM, Peter Maydell
<peter.mayd...@linaro.org> wrote:
> On 22 March 2016 at 16:15, haris iqbal <haris.p...@gmail.com> 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. Then its safe to say that changing the free() in unlock_user()
to g_free() would do the job for the malloc() to g_malloc() change in
lock_user().

>
> thanks
> -- PMM



-- 

With regards,

Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962

Reply via email to