uri: Prevent memory leak when opening compressed files

This commit is contained in:
mintsuki 2023-02-15 21:05:55 +01:00
parent 82aec4b1b2
commit 9b07351208

View File

@ -282,8 +282,9 @@ struct file_handle *uri_open(char *uri) {
compressed_fd->path = ext_mem_alloc(ret->path_len);
memcpy(compressed_fd->path, ret->path, ret->path_len);
compressed_fd->path_len = ret->path_len;
fclose(ret);
compressed_fd->is_memfile = true;
fclose(ret);
pmm_free(src, ret->size);
ret = compressed_fd;
}