mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-25 05:21:58 +00:00
found this bug in the main tere. We should die gracefully if we can't allocate memory for the zone.
This commit is contained in:
parent
9b46606595
commit
a7b5176e68
1 changed files with 4 additions and 0 deletions
|
@ -420,6 +420,10 @@ int main (int c, char **v)
|
||||||
if (j)
|
if (j)
|
||||||
parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024);
|
parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024);
|
||||||
parms.membase = malloc (parms.memsize);
|
parms.membase = malloc (parms.memsize);
|
||||||
|
if (!perms.membase) {
|
||||||
|
printf("Can't allocate memroy for zone.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
parms.basedir = basedir;
|
parms.basedir = basedir;
|
||||||
// caching is disabled by default, use -cachedir to enable
|
// caching is disabled by default, use -cachedir to enable
|
||||||
|
|
Loading…
Reference in a new issue