Close fd on error
This commit is contained in:
parent
bb53fe2482
commit
19d859fb8b
@ -38,6 +38,7 @@ sus_File sus_fileOpenInMem(char * fileName, unsigned long parameter) {
|
|||||||
void *mem = mmap(NULL, info.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
void *mem = mmap(NULL, info.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||||
|
|
||||||
if(mem == MAP_FAILED) {
|
if(mem == MAP_FAILED) {
|
||||||
|
close(fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user