Skip to content

Commit

Permalink
fix: close tmp files (wagoodman#517)
Browse files Browse the repository at this point in the history
Co-authored-by: guoguangwu <guoguangwug@gmail.com>
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
  • Loading branch information
joschi and testwill committed Nov 7, 2024
1 parent 4f7eaaa commit 5529f11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dive/image/docker/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func buildImageFromCli(buildArgs []string) (string, error) {
return "", err
}
defer os.Remove(iidfile.Name())
defer iidfile.Close()

allArgs := append([]string{"--iidfile", iidfile.Name()}, buildArgs...)
err = runDockerCmd("build", allArgs...)
Expand Down
1 change: 1 addition & 0 deletions dive/image/podman/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func buildImageFromCli(buildArgs []string) (string, error) {
return "", err
}
defer os.Remove(iidfile.Name())
defer iidfile.Close()

allArgs := append([]string{"--iidfile", iidfile.Name()}, buildArgs...)
err = runPodmanCmd("build", allArgs...)
Expand Down

0 comments on commit 5529f11

Please sign in to comment.