Merge "Close opened paths"

This commit is contained in:
Treehugger Robot
2022-02-08 00:33:04 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 0 deletions

View File

@@ -716,6 +716,7 @@ func GetMainClassInManifest(c Config, filepath string) (string, error) {
if err != nil {
return "", err
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()

View File

@@ -378,6 +378,7 @@ func loadSoongConfigModuleTypeDefinition(ctx LoadHookContext, from string) map[s
ctx.PropertyErrorf("from", "failed to open %q: %s", from, err)
return (map[string]blueprint.ModuleFactory)(nil)
}
defer r.Close()
mtDef, errs := soongconfig.Parse(r, from)
if ctx.Config().runningAsBp2Build {