commit | 2ed20f87684a892d640a91f1961f369bbbc7d05e | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Mon Dec 13 14:32:17 2010 -0800 |
committer | Nick Kralevich <nnk@google.com> | Mon Dec 13 14:32:17 2010 -0800 |
tree | 52ece9413a6feb7be05d9d5cb31b48860a62e92f | |
parent | e3f6336bcffc250da90ec864bccfa73ad1d016b9 [diff] |
Avoid leaking sockets. When a DNS lookup fails, we end up creating a datagram socket but never properly close it. This wastes limited valuable file descriptors and causes CTS test failures. Generally, we should ensure that sockets or files are opened in a try block, and closed in a finally block. Bug: 3276283 Change-Id: I3432f3bc061268c7367948230f6edbdfcec55892