Skip to content

Commit

Permalink
core: close stdoutPipe
Browse files Browse the repository at this point in the history
Closing stdoutPipe that could possibly
leaks memory due to unclosed resources.

Closes: #8914
Signed-off-by: subhamkrai <srai@redhat.com>
  • Loading branch information
subhamkrai committed Oct 5, 2021
1 parent 078f648 commit ee70937
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/daemon/discover/discover.go
Expand Up @@ -158,6 +158,7 @@ func rawUdevBlockMonitor(c chan string, matches, exclusions []string) {
logger.Warningf("Cannot open udevadm stdout: %v", err)
return
}
defer stdout.Close()

err = cmd.Start()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/util/exec/exec.go
Expand Up @@ -238,6 +238,7 @@ func startCommand(env []string, command string, arg ...string) (*exec.Cmd, io.Re
if err != nil {
logger.Warningf("failed to open stdout pipe: %+v", err)
}
defer stdout.Close()
stderr, err := cmd.StderrPipe()
if err != nil {
logger.Warningf("failed to open stderr pipe: %+v", err)
Expand Down

0 comments on commit ee70937

Please sign in to comment.