RSRV: fix large buffer resize
Take into account that realloc may already have moved the data to a new buffer.
This commit is contained in:
committed by
Michael Davidsaver
parent
d814d67a35
commit
6903562915
@@ -1343,10 +1343,13 @@ void casExpandBuffer ( struct message_buffer *buf, ca_uint32_t size, int sendbuf
|
||||
// round up to multiple of 4K
|
||||
size = ((size-1)|0xfff)+1;
|
||||
|
||||
if (buf->type==mbtLargeTCP)
|
||||
if (buf->type==mbtLargeTCP) {
|
||||
newbuf = realloc (buf->buf, size);
|
||||
else
|
||||
if(newbuf)
|
||||
buf->buf = newbuf;
|
||||
} else {
|
||||
newbuf = malloc (size);
|
||||
}
|
||||
newtype = mbtLargeTCP;
|
||||
newsize = size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user