Commit 5282390e authored by Jeremy Newton-Smith's avatar Jeremy Newton-Smith Committed by Commit Bot

Fixes a file descriptor leak when determining build type

assets/cast_config was being accessed.

Bug: Internal 111712809
Test: Verified that file descriptors were no longer being leaked when
Change-Id: Ide58d71f9f284255cb1d73f3dadae111875be453
Reviewed-on: https://chromium-review.googlesource.com/1148686Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Jeremy Newton-Smith <jeremyns@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577651}
parent 4380217c
...@@ -40,6 +40,8 @@ bool DoesCastConfigFileExist() { ...@@ -40,6 +40,8 @@ bool DoesCastConfigFileExist() {
base::MemoryMappedFile::Region config_region; base::MemoryMappedFile::Region config_region;
int config_fd = int config_fd =
base::android::OpenApkAsset(kCastConfigAssetPath, &config_region); base::android::OpenApkAsset(kCastConfigAssetPath, &config_region);
if (config_fd > 0)
close(config_fd);
return config_fd > 0; return config_fd > 0;
} }
} // namespace } // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment