No description
Find a file
David 'Digit' Turner 4661fda2e5 libc: Fix leak in the DNS thread-specific state.
This patch fixes a leak that occurs when creating a new
thread-specific DNS resolver state object.

Essentially, each thread that calls gethostbyname() or getaddrinfo()
at least once will leak a small memory block. Another leak happens
anytime these functions are called after a change of the network
settings.

The leak is insignificant and hard to notice on typical programs.
However, netd tends to create one new thread for each DNS request
it processes, and quickly grows in size after a > 20 hours.

The same problem is seen in other system processes that tend to
create one thread per request too.

The leak occured becasue res_ninit() was called twice when creating
a new thread-specific DNS resolver state in _res_get_thread().

This function could not properly reset an existing thread and was
leaking a memory block.

The patch does two things:

- First, it fixes res_ninit() to prevent any leakage when resetting
  the state of a given res_state instance.

- Second, it modifies the _res_get_thread() implementation to
  make it more explicit, and avoid calling res_ninit() twice
  in a row on first-time creation.

Fix for Bug 4089945, and Bug 4090857

Change-Id: Ie4831a8dbe82be8f07fce5ddd1d36bf95994f836
2011-03-18 18:08:08 +01:00
libc libc: Fix leak in the DNS thread-specific state. 2011-03-18 18:08:08 +01:00
libdl Added support for dladdr() 2010-03-17 16:11:37 -05:00
libm libm: Add nanf() and tgammaf() implementations. 2011-01-25 17:07:26 +01:00
libstdc++ Fix the build. Oops. 2010-10-11 15:27:39 +02:00
libthread_db move some typedefs to procfs.h required by gdbserver build 2011-02-03 12:21:02 -08:00
linker Increase SO_MAX to accomodate valgrind 2011-02-10 17:02:23 -08:00
.gitignore Merge memory checking functionality from sandbox 2010-02-16 11:43:18 -08:00
Android.mk Apply https://android-git.corp.google.com/g/60855 to dalvik-dev. 2010-08-18 00:33:52 -07:00
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:04:02 -08:00
MAINTAINERS added and modified libm to support SuperH architecture 2009-08-31 16:25:42 +09:00
ThirdPartyProject.prop add meta-files about 3rd party projects 2010-07-16 11:41:33 -07:00