Skip to content

Commit

Permalink
files-reg: don't leak a file descriptor
Browse files Browse the repository at this point in the history
CID 154850 (#1 of 1): Resource leak (RESOURCE_LEAK)
9. leaked_handle: Handle variable cwd_fd going out of scope leaks the handle.

Reported-by: coverity
  • Loading branch information
avagin committed Nov 26, 2015
1 parent c399e72 commit f0c6195
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions files-reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ void try_clean_remaps(int ns_fd)

if (setns(ns_fd, CLONE_NEWNS) < 0) {
close(old_ns);
close(cwd_fd);
pr_perror("`- Can't switch");
return;
}
Expand Down

0 comments on commit f0c6195

Please sign in to comment.