mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-27 06:13:01 +00:00
mmap could fail, handle gracefully
This commit is contained in:
parent
f19d437564
commit
4abf1aa398
1 changed files with 2 additions and 0 deletions
|
@ -106,6 +106,8 @@ int mumble_link(const char* name)
|
||||||
lm = (LinkedMem *) (mmap(NULL, sizeof(LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0));
|
lm = (LinkedMem *) (mmap(NULL, sizeof(LinkedMem), PROT_READ | PROT_WRITE, MAP_SHARED, shmfd,0));
|
||||||
if (lm == (void *) (-1)) {
|
if (lm == (void *) (-1)) {
|
||||||
lm = NULL;
|
lm = NULL;
|
||||||
|
close(shmfd);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
close(shmfd);
|
close(shmfd);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue