qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/6] linux-user: do_msgrcv: don't leak host_mb u


From: Jim Meyering
Subject: Re: [Qemu-devel] [PATCH 3/6] linux-user: do_msgrcv: don't leak host_mb upon TARGET_EFAULT failure
Date: Wed, 16 May 2012 15:50:15 +0200

Peter Maydell wrote:

> On 16 May 2012 14:07, Jim Meyering <address@hidden> wrote:
>> From: Jim Meyering <address@hidden>
>>
>>
>> Signed-off-by: Jim Meyering <address@hidden>
>> ---
>>  linux-user/syscall.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>> index 20d2a74..bdf8ce0 100644
>> --- a/linux-user/syscall.c
>> +++ b/linux-user/syscall.c
>> @@ -2814,6 +2814,7 @@ static inline abi_long do_msgrcv(int msqid, abi_long 
>> msgp,
>>  end:
>>     if (target_mb)
>>         unlock_user_struct(target_mb, msgp, 1);
>> +    free(host_mb);
>>     return ret;
>>  }
>
> This will cause us to free() host_mb twice in the normal-return case.

Good catch.  Thanks.
V2 corrects that.



reply via email to

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