file: Convert file to a memfile as soon as possible

This commit is contained in:
czapek1337 2022-09-11 20:21:17 +02:00
parent 8906518cd2
commit a1bcf3c09b
No known key found for this signature in database
GPG Key ID: 2F5F3AE42F4E7E2C
1 changed files with 4 additions and 0 deletions

View File

@ -106,6 +106,10 @@ void *freadall(struct file_handle *fd, uint32_t type) {
} else {
void *ret = ext_mem_alloc_type(fd->size, type);
fd->read(fd, ret, 0, fd->size);
fd->close(fd);
fd->is_memfile = true;
fd->readall = true;
fd->fd = ret;
return ret;
}
}