Re: [Xen-devel] [PATCH 2/9] libxl: turn two malloc's to libxl__malloc

2015-07-13 Thread Wei Liu
On Mon, Jul 13, 2015 at 11:00:15AM +0100, Ian Campbell wrote: > On Fri, 2015-07-10 at 19:00 +0100, Wei Liu wrote: > > One is to combine malloc + libxl__alloc_failed. The other is to avoid > > dereferencing NULL pointer in case of malloc failure. > > The non-use of a gc for the latter in particular

Re: [Xen-devel] [PATCH 2/9] libxl: turn two malloc's to libxl__malloc

2015-07-13 Thread Ian Campbell
On Fri, 2015-07-10 at 19:00 +0100, Wei Liu wrote: > One is to combine malloc + libxl__alloc_failed. The other is to avoid > dereferencing NULL pointer in case of malloc failure. The non-use of a gc for the latter in particular looks a bit suspicious to me, but nonetheless this is an improvement:

[Xen-devel] [PATCH 2/9] libxl: turn two malloc's to libxl__malloc

2015-07-10 Thread Wei Liu
One is to combine malloc + libxl__alloc_failed. The other is to avoid dereferencing NULL pointer in case of malloc failure. Signed-off-by: Wei Liu --- tools/libxl/libxl_aoutils.c | 3 +-- tools/libxl/libxl_dm.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/lib