[PATCH 02/11] xf86AutoConfig: make copyScreen memory allocation & error handling more sane

Julien Cristau jcristau at debian.org
Tue Nov 30 01:39:17 PST 2010


On Mon, Nov 29, 2010 at 20:57:39 -0800, Alan Coopersmith wrote:

> No point calling the no-fail-alloc if you check for failure and your
> only caller checks for failure.
> 
> No point calling calloc to zero fill memory you're about to memcpy over.
> 
> In the unlikely event of a loss of memory allocation, drop your previous
> allocations before returning to others.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  hw/xfree86/common/xf86AutoConfig.c |   20 +++++++++++++++-----
>  1 files changed, 15 insertions(+), 5 deletions(-)
> 
Reviewed-by: Julien Cristau <jcristau at debian.org>

Cheers,
Julien


More information about the xorg-devel mailing list