diff options
author | Luke Huang <huangluke@google.com> | 2020-12-23 11:49:11 +0800 |
---|---|---|
committer | Luke Huang <huangluke@google.com> | 2021-04-07 02:05:50 +0800 |
commit | 75830fb836621ebbcf68155e466983eb231f9ca1 (patch) | |
tree | a1c39b03cb64c10de36b2af16c7d1f1b6c91bf69 /libc/bionic/bionic_appcompat.cpp | |
parent | e71143e8c0016137a5fe005d7c39fbb03922f1f4 (diff) |
Initialize _nres only once
Currently, the initialization of _nres is not thread-saferes_mkquery is not thread-safe,
which might cause memory double free problem if caller ran under multithread.
To fix it, only initialize _nres once.
Also remove the redundant code.
Test: atest DnsResolverTest
Bug: 166235340
Change-Id: I9caa6eab37cb530fc60dae9bcca9650973a4536a
Diffstat (limited to 'libc/bionic/bionic_appcompat.cpp')
0 files changed, 0 insertions, 0 deletions