Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix use after free #22854

Merged
merged 1 commit into from
Oct 23, 2023
Merged

fix use after free #22854

merged 1 commit into from
Oct 23, 2023

Conversation

haoyu234
Copy link
Contributor

  1. freeAddrInfo is called prematurely, the variable myAddr is still in use
  2. Use defer syntax to ensure that freeAddrInfo is also called on exceptions

@Araq
Copy link
Member

Araq commented Oct 23, 2023

Ping @narimiran please backport.

@Araq Araq merged commit 562a5fb into nim-lang:devel Oct 23, 2023
19 checks passed
@github-actions
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 562a5fb

Hint: mm: orc; opt: speed; options: -d:release
174734 lines; 9.085s; 769.91MiB peakmem

narimiran pushed a commit that referenced this pull request Oct 24, 2023
1. `freeAddrInfo` is called prematurely, the variable `myAddr` is still
in use
2. Use defer syntax to ensure that `freeAddrInfo` is also called on
exceptions

(cherry picked from commit 562a5fb)
@narimiran
Copy link
Member

Ping @narimiran please backport.

To backport this, I also had to backport #22843. Both now available in 2.0.x

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.

3 participants