glx: realloc style fix in RenderLarge
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
@@ -2176,15 +2176,12 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
|||||||
** Make enough space in the buffer, then copy the entire request.
|
** Make enough space in the buffer, then copy the entire request.
|
||||||
*/
|
*/
|
||||||
if (cl->largeCmdBufSize < cmdlen) {
|
if (cl->largeCmdBufSize < cmdlen) {
|
||||||
if (!cl->largeCmdBuf) {
|
GLbyte *newbuf = cl->largeCmdBuf;
|
||||||
cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
|
|
||||||
}
|
if (!(newbuf = realloc(newbuf, cmdlen)))
|
||||||
else {
|
return BadAlloc;
|
||||||
cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
|
|
||||||
}
|
cl->largeCmdBuf = newbuf;
|
||||||
if (!cl->largeCmdBuf) {
|
|
||||||
return BadAlloc;
|
|
||||||
}
|
|
||||||
cl->largeCmdBufSize = cmdlen;
|
cl->largeCmdBufSize = cmdlen;
|
||||||
}
|
}
|
||||||
memcpy(cl->largeCmdBuf, pc, dataBytes);
|
memcpy(cl->largeCmdBuf, pc, dataBytes);
|
||||||
|
|||||||
Reference in New Issue
Block a user