Close fd on error

This commit is contained in:
MrLetsplay 2022-08-29 15:24:28 +02:00
parent bb53fe2482
commit 19d859fb8b

View File

@ -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);
if(mem == MAP_FAILED) {
close(fd);
return NULL;
}