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

Re: [Xen-devel] [PATCH v2 1/3] xc/tmem: Free temporary buffer used during migration



>>> On 07.05.14 at 08:30, <lliubbo@xxxxxxxxx> wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> 
> CID 1090388.
> 
> Within the loop reading the pool_id we set the buf:
> 
>  if ( (buf = realloc(buf,bufsize)) == NULL )
> 
> and then continue on using it without freeing. Worst yet
> there are multiple 'if (..) return -1' which do not free
> the buffer.
> 
> As such insert a 'fail' goto label to free the buffer
> and also add on the OK path a mechanism to free the buffer.
> 
> Replace all of the 'return -1' with a jump to the failed
> label.
> 
> v2:
> * Remove superfluous braces. (Andrew)
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> Signed-off-by: Bob Liu <bob.liu@xxxxxxxxxx>
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
>  tools/libxc/xc_tmem.c |   44 ++++++++++++++++++++++++++------------------
>  1 file changed, 26 insertions(+), 18 deletions(-)

For this and the second patch you ought to Cc the tools maintainers
instead of the hypervisor ones, and for the third patch Cc-ing the
tmem maintainer would be sufficient.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.