Skip to content

Commit

Permalink
tun: don't leak a file descriptor
Browse files Browse the repository at this point in the history
CID 84654 (#1 of 1): Resource leak (RESOURCE_LEAK)
6. leaked_handle: Handle variable fd going out of scope leaks the handle.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  • Loading branch information
avagin committed May 17, 2018
1 parent 7ed045c commit 237260f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion criu/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static int tunfile_open(struct file_desc *d, int *new_fd)

ns_id = ti->tfe->ns_id;
if (set_netns(ns_id))
return -1;
goto err;

if (!ti->tfe->netdev)
/* just-opened tun file */
Expand Down

0 comments on commit 237260f

Please sign in to comment.