[PATCH:libXxf86vm] When Xcalloc() returns NULL, you don't need to Xfree() it

Alan Coopersmith alan.coopersmith at oracle.com
Sun Apr 14 08:19:00 PDT 2013


On 04/14/13 04:25 AM, walter harms wrote:
>>   	if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
>
> you can improve readability by splitting the if()
>
> modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)) ;
> if (!modeline->private)

Yes, I ended up doing that in the later patches, since I found it annoying to
read too.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list