Merge "Close opened paths" am: 217a70e713 am: 4c8f8b8c00

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1972548

Change-Id: I2d36dd67b02065c4bd58beb946f6d102b5bf5036
This commit is contained in:
Treehugger Robot
2022-02-08 01:08:52 +00:00
committed by Automerger Merge Worker
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 {