unix: fix memory leak when uv_loop_init() fails
`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: https://github.com/libuv/libuv/pull/2837 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
7ccea60b1f
commit
55dede5b6f
@ -106,6 +106,8 @@ fail_rwlock_init:
|
||||
fail_signal_init:
|
||||
uv__platform_loop_delete(loop);
|
||||
|
||||
uv__free(loop->watchers);
|
||||
loop->nwatchers = 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user