Skip to content

fix memory leak in os.read_entire_file(...) example in read-a-file-line-by-line#318

Open
MaierN wants to merge 1 commit into
odin-lang:masterfrom
MaierN:master
Open

fix memory leak in os.read_entire_file(...) example in read-a-file-line-by-line#318
MaierN wants to merge 1 commit into
odin-lang:masterfrom
MaierN:master

Conversation

@MaierN

@MaierN MaierN commented May 10, 2026

Copy link
Copy Markdown

The implementation of os.read_entire_file may allocate memory for a slice and then return an error, therefore we should defer delete the slice before we return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant