Replace remaining instances of regular malloc/calloc/realloc/strdup with our memory error handler versions

git-svn-id: https://svn.eduke32.com/eduke32@7079 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-10-25 23:28:56 +00:00
parent 9613bbac33
commit 1f8b23152e
21 changed files with 77 additions and 74 deletions

View file

@ -447,7 +447,7 @@ static GLuint polymost2_compileShader(GLenum shaderType, const char* const sourc
OSD_Printf("Compile Status: %u\n", compileStatus);
if (logLength > 0)
{
char *infoLog = (char*) malloc(logLength);
char *infoLog = (char*)Xmalloc(logLength);
glGetShaderInfoLog(shaderID, logLength, &logLength, infoLog);
OSD_Printf("Log:\n%s\n", infoLog);
free(infoLog);
@ -2470,13 +2470,13 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp
lastfn = fn; // careful...
if (!lastpic)
{
lastpic = (coltype *)Bmalloc(siz.x*siz.y*sizeof(coltype));
lastpic = (coltype *)Xmalloc(siz.x*siz.y*sizeof(coltype));
lastsize = siz.x*siz.y;
}
else if (lastsize < siz.x*siz.y)
{
Bfree(lastpic);
lastpic = (coltype *)Bmalloc(siz.x*siz.y*sizeof(coltype));
lastpic = (coltype *)Xmalloc(siz.x*siz.y*sizeof(coltype));
}
if (lastpic)
Bmemcpy(lastpic, pic, siz.x*siz.y*sizeof(coltype));