mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-29 15:51:45 +00:00
Don't free() the download queues last element twice.
While at it replace the crappy Z_TagMalloc() with the standard malloc(). Z_TagMalloc() ist just a wrapper arround malloc(), there's no functional change.
This commit is contained in:
parent
eb048e8611
commit
e05f95e3fb
1 changed files with 12 additions and 7 deletions
|
@ -165,7 +165,8 @@ static qboolean CL_RemoveFromQueue(dlqueue_t *entry)
|
||||||
if (last->next == entry)
|
if (last->next == entry)
|
||||||
{
|
{
|
||||||
last->next = cur->next;
|
last->next = cur->next;
|
||||||
Z_Free(cur);
|
free(cur);
|
||||||
|
cur = NULL;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -809,7 +810,7 @@ void CL_HTTP_Cleanup(qboolean fullShutdown)
|
||||||
|
|
||||||
if (dl->tempBuffer)
|
if (dl->tempBuffer)
|
||||||
{
|
{
|
||||||
Z_Free (dl->tempBuffer);
|
free(dl->tempBuffer);
|
||||||
dl->tempBuffer = NULL;
|
dl->tempBuffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -837,7 +838,8 @@ void CL_HTTP_Cleanup(qboolean fullShutdown)
|
||||||
|
|
||||||
if (last)
|
if (last)
|
||||||
{
|
{
|
||||||
Z_Free (last);
|
free(last);
|
||||||
|
last = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
last = q;
|
last = q;
|
||||||
|
@ -845,7 +847,8 @@ void CL_HTTP_Cleanup(qboolean fullShutdown)
|
||||||
|
|
||||||
if (last)
|
if (last)
|
||||||
{
|
{
|
||||||
Z_Free (last);
|
free(last);
|
||||||
|
last = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup CURL multihandle.
|
// Cleanup CURL multihandle.
|
||||||
|
@ -898,7 +901,8 @@ void CL_SetHTTPServer (const char *URL)
|
||||||
|
|
||||||
if (last)
|
if (last)
|
||||||
{
|
{
|
||||||
Z_Free (last);
|
free(last);
|
||||||
|
last = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
last = q;
|
last = q;
|
||||||
|
@ -906,7 +910,8 @@ void CL_SetHTTPServer (const char *URL)
|
||||||
|
|
||||||
if (last)
|
if (last)
|
||||||
{
|
{
|
||||||
Z_Free (last);
|
free(last);
|
||||||
|
last = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (&cls.downloadQueue, 0, sizeof(cls.downloadQueue));
|
memset (&cls.downloadQueue, 0, sizeof(cls.downloadQueue));
|
||||||
|
@ -1000,7 +1005,7 @@ qboolean CL_QueueHTTPDownload(const char *quakePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
q->next = Z_TagMalloc(sizeof(*q), 0);
|
q->next = malloc(sizeof(*q));
|
||||||
q = q->next;
|
q = q->next;
|
||||||
q->next = NULL;
|
q->next = NULL;
|
||||||
q->state = DLQ_STATE_NOT_STARTED;
|
q->state = DLQ_STATE_NOT_STARTED;
|
||||||
|
|
Loading…
Reference in a new issue