build: cleanup res if returned in basic build

In practice, this shouldn't happen, but the check is good to include
anyways.

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell 2023-05-31 15:13:00 +01:00
parent cd1648192e
commit 5b27d5a9f6
1 changed files with 4 additions and 1 deletions

View File

@ -297,7 +297,10 @@ func runBuild(dockerCli command.Cli, options buildOptions) (err error) {
}
func runBasicBuild(ctx context.Context, dockerCli command.Cli, opts *controllerapi.BuildOptions, options buildOptions, printer *progress.Printer) (*client.SolveResponse, error) {
resp, _, err := cbuild.RunBuild(ctx, dockerCli, *opts, os.Stdin, printer, false)
resp, res, err := cbuild.RunBuild(ctx, dockerCli, *opts, os.Stdin, printer, false)
if res != nil {
res.Done()
}
return resp, err
}