Fix a memory leak in hotplug2 environment handling.
authorFelix Fietkau <nbd@openwrt.org>
Wed, 9 Dec 2009 18:50:49 +0000 (18:50 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 9 Dec 2009 18:50:49 +0000 (18:50 +0000)
commit13a47975cfc2cf5c7cbae7507642b8c1129106c3
tree7824c973e3314bc2a840fb7622271cadbb476723
parent6412608fa5524867ef292d9e67b8f3edf4af26bc
Fix a memory leak in hotplug2 environment handling.
Bump hotplug2 to the latest svn revision, remove obsolete patches.

Memory leak is caused by the way hotplug2 handles environment variables,
using setenv() and unsetenv(). setenv() creates copies of the supplied
strings, but, due to a POSIX blunder, these copies are never destroyed
by unsetenv(), neither in glibc nor uclibc - not until the program
terminates.

Since some events are handled directly in the main process, even when
configured with the "fork" worker, hotplug2 memory usage will keep
growing over time. This can be observed by running "udevtrigger" and
noting the increase in hotplug2 VmRSS after each run.

This patch uses putenv() instead, which leaves storage management to
the caller, so that we can explicitly delete stuff when it's no longer
needed.

Signed-off-by: Aleksandar Radovanovic <biblbroks@sezampro.rs>
SVN-Revision: 18725
package/hotplug2/Makefile
package/hotplug2/patches/100-env_memleak.patch [new file with mode: 0644]
package/hotplug2/patches/100-recv_check.patch [deleted file]
package/hotplug2/patches/110-static_worker.patch