Message ID | 20240206235416.18086-1-maks.mishinFZ@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Stephen Hemminger |
Headers | show |
Series | ctrl: Fix fd leak in ctrl_listen() | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch |
diff --git a/genl/ctrl.c b/genl/ctrl.c index aff922a4..783c3591 100644 --- a/genl/ctrl.c +++ b/genl/ctrl.c @@ -333,8 +333,10 @@ static int ctrl_listen(int argc, char **argv) return -1; } - if (rtnl_listen(&rth, print_ctrl, (void *) stdout) < 0) + if (rtnl_listen(&rth, print_ctrl, (void *) stdout) < 0) { + rtnl_close(&rth); return -1; + } return 0; }
Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com> --- genl/ctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)