Close opened paths
Test: m nothing
Change-Id: I7fcc8e2fdbca1cd231ff1e72b02156f12078072b
diff --git a/android/bazel.go b/android/bazel.go
index 5d1507c..e3c791c 100644
--- a/android/bazel.go
+++ b/android/bazel.go
@@ -713,6 +713,7 @@
if err != nil {
return "", err
}
+ defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
diff --git a/android/soong_config_modules.go b/android/soong_config_modules.go
index 91bbce6..bd73645 100644
--- a/android/soong_config_modules.go
+++ b/android/soong_config_modules.go
@@ -378,6 +378,7 @@
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 {