Re: [PATCH 1/1] libsepol/cil: do not dereference a NULL pointer when calloc() fails

2017-03-28 Thread James Carter
On 03/25/2017 09:48 AM, Nicolas Iooss wrote: When list_init() fails to allocate a list with calloc(), it calls list_destroy() with l = NULL. This functions starts by dereferencing its argument ("(*list)->head"), which does not work well when it is NULL. This bug can be fixed by returning

[PATCH 1/1] libsepol/cil: do not dereference a NULL pointer when calloc() fails

2017-03-25 Thread Nicolas Iooss
When list_init() fails to allocate a list with calloc(), it calls list_destroy() with l = NULL. This functions starts by dereferencing its argument ("(*list)->head"), which does not work well when it is NULL. This bug can be fixed by returning directly in list_init() when calloc() fails. Doing so