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:
parent
9ebf739a68
commit
acf14c1de7
|
@ -2176,15 +2176,12 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
|||
** Make enough space in the buffer, then copy the entire request.
|
||||
*/
|
||||
if (cl->largeCmdBufSize < cmdlen) {
|
||||
if (!cl->largeCmdBuf) {
|
||||
cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
|
||||
}
|
||||
else {
|
||||
cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
|
||||
}
|
||||
if (!cl->largeCmdBuf) {
|
||||
return BadAlloc;
|
||||
}
|
||||
GLbyte *newbuf = cl->largeCmdBuf;
|
||||
|
||||
if (!(newbuf = realloc(newbuf, cmdlen)))
|
||||
return BadAlloc;
|
||||
|
||||
cl->largeCmdBuf = newbuf;
|
||||
cl->largeCmdBufSize = cmdlen;
|
||||
}
|
||||
memcpy(cl->largeCmdBuf, pc, dataBytes);
|
||||
|
|
Loading…
Reference in New Issue
Block a user