Coverity #769: Fix a potential memory leak for systems that allocate on

malloc(0)
This commit is contained in:
Adam Jackson 2006-04-07 01:50:07 +00:00
commit 20c1ef2cc3
2 changed files with 7 additions and 1 deletions

View file

@ -801,7 +801,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
}
buf_size = __glReadPixels_size(format,type,width,height, &ebits, &rowsize);
if (buf_size >= 0) {
if (buf_size > 0) {
buf = (char *) Xalloc( buf_size );
if ( !buf ) {
return( BadAlloc );