Skip to content

unix: fix memory leak when uv_loop_init() fails#2837

Closed
addaleax wants to merge 2 commits intolibuv:v1.xfrom
addaleax:loop-init-memleak
Closed

unix: fix memory leak when uv_loop_init() fails#2837
addaleax wants to merge 2 commits intolibuv:v1.xfrom
addaleax:loop-init-memleak

Conversation

@addaleax
Copy link
Copy Markdown
Contributor

@addaleax addaleax commented May 7, 2020

uv_signal_init() leads to the allocation of an IO watcher,
so if the loop initialization fails at a later point,
the loop->watchers list needs to be released.

`uv_signal_init()` leads to the allocation of an IO watcher,
so if the loop initialization fails at a later point,
the `loop->watchers` list needs to be released.
@addaleax
Copy link
Copy Markdown
Contributor Author

addaleax commented May 7, 2020

Comment thread src/unix/loop.c Outdated
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
@addaleax
Copy link
Copy Markdown
Contributor Author

addaleax commented May 9, 2020

addaleax added a commit that referenced this pull request May 9, 2020
`uv_signal_init()` leads to the allocation of an IO watcher,
so if the loop initialization fails at a later point,
the `loop->watchers` list needs to be released.

PR-URL: #2837
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@addaleax
Copy link
Copy Markdown
Contributor Author

addaleax commented May 9, 2020

Landed in 55dede5

@addaleax addaleax closed this May 9, 2020
@addaleax addaleax deleted the loop-init-memleak branch May 9, 2020 19:17
JeffroMF pushed a commit to JeffroMF/libuv that referenced this pull request May 16, 2022
`uv_signal_init()` leads to the allocation of an IO watcher,
so if the loop initialization fails at a later point,
the `loop->watchers` list needs to be released.

PR-URL: libuv#2837
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
liujinye-sys pushed a commit to open-vela/apps_system_libuv that referenced this pull request Jul 23, 2025
`uv_signal_init()` leads to the allocation of an IO watcher,
so if the loop initialization fails at a later point,
the `loop->watchers` list needs to be released.

PR-URL: libuv/libuv#2837
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
liujinye-sys pushed a commit to open-vela/apps_system_libuv that referenced this pull request Dec 16, 2025
`uv_signal_init()` leads to the allocation of an IO watcher,
so if the loop initialization fails at a later point,
the `loop->watchers` list needs to be released.

PR-URL: libuv/libuv#2837
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
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.

4 participants