summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2006-04-07 01:50:07 +0000
committerAdam Jackson <ajax@nwnk.net>2006-04-07 01:50:07 +0000
commit20c1ef2cc30abe45eeaf5b0833cbc0095ed05c02 (patch)
tree9fd2228bb9570790ff23e3fae85cfb3f23d721ee
parent5ef711032b821be82fd7281fe64872bcbaff0327 (diff)
Coverity #769: Fix a potential memory leak for systems that allocate on
malloc(0)
-rw-r--r--ChangeLog6
-rw-r--r--hw/dmx/glxProxy/glxsingle.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 11c0ecf15..d12e08ae8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-04-06 Adam Jackson <ajax@freedesktop.org>
+ * hw/dmx/glxProxy/glxsingle.c:
+ Coverity #769: Fix a potential memory leak for systems that
+ allocate on malloc(0)
+
+2006-04-06 Adam Jackson <ajax@freedesktop.org>
+
* hw/xfree86/common/xf86Config.c:
Coverity #838: Plug two more memory leaks.
diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c
index 5a8f72736..e353263a7 100644
--- a/hw/dmx/glxProxy/glxsingle.c
+++ b/hw/dmx/glxProxy/glxsingle.c
@@ -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 );