qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong


From: Orit Wasserman
Subject: Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf wrong
Date: Wed, 22 Jan 2014 07:51:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 01/21/2014 02:58 PM, Gonglei (Arei) wrote:

-----Original Message-----
From: Orit Wasserman [mailto:address@hidden
Sent: Tuesday, January 21, 2014 8:24 PM
To: Gonglei (Arei); address@hidden; address@hidden; Peter
Maydell; address@hidden; address@hidden
Cc: chenliang (T); Luonengjun; Huangweidong (Hardware)
Subject: Re: [Qemu-devel] [PATCH v2] migration:fix free XBZRLE decoded_buf
wrong

On 01/21/2014 02:11 PM, Gonglei (Arei) wrote:
Hi,

This is an update of my patch.
Modifications in v2:
* Removing excess check for g_free
* The structure of XBZRLE is divided into two halves.One is for
* src side, another is for dest side.


What is the benefit of splitting the structure?
decode_buf is only allocated (and freed) in the destination any way.

Yeah, you are right. Splitting the structure is not necessary.
The key to do that is just for clear logic. As Peter said:
the current arrangement looks extremely prone to bugs like
this one where somebody forgets that some of the fields are
not relevant to whichever of src/dst the code path they're
writing is used on.

Best regards,
-Gonglei


Sounds reasonable.
Thanks for finding the leak and fixing it.

Orit

Orit




reply via email to

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