uri: Fix minor use-after-free bug

This commit is contained in:
mintsuki 2023-02-15 21:09:46 +01:00
parent d22b97cf66
commit ccb0d0f738

View File

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