mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-17 01:21:12 +00:00
Merge pull request #423 from devnexen/curl_build_fix
curl buffer resizing lost fix proposal.
This commit is contained in:
commit
56b3d91786
1 changed files with 7 additions and 1 deletions
|
@ -87,7 +87,13 @@ static size_t CL_HTTP_Recv(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||||
else if (dl->position + bytes >= dl->fileSize)
|
else if (dl->position + bytes >= dl->fileSize)
|
||||||
{
|
{
|
||||||
dl->fileSize *= 2;
|
dl->fileSize *= 2;
|
||||||
realloc(dl->tempBuffer, dl->fileSize);
|
char *tempBuffer = realloc(dl->tempBuffer, dl->fileSize);
|
||||||
|
if (!tempBuffer) {
|
||||||
|
free(dl->tempBuffer);
|
||||||
|
dl->tempBuffer = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
dl->tempBuffer = tempBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (dl->tempBuffer + dl->position, ptr, bytes);
|
memcpy (dl->tempBuffer + dl->position, ptr, bytes);
|
||||||
|
|
Loading…
Reference in a new issue