mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-10 23:33:46 +00:00
Coverity #769: Fix a potential memory leak for systems that allocate on
malloc(0)
This commit is contained in:
parent
5ef711032b
commit
20c1ef2cc3
2 changed files with 7 additions and 1 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue