mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
Merge pull request #2320 from evverx/fix-memory-leak-on-reload
Fix memory leak on daemon-reload
This commit is contained in:
commit
ca9ec350f3
@ -989,7 +989,7 @@ Manager* manager_free(Manager *m) {
|
||||
free(m->switch_root_init);
|
||||
|
||||
for (i = 0; i < _RLIMIT_MAX; i++)
|
||||
free(m->rlimit[i]);
|
||||
m->rlimit[i] = mfree(m->rlimit[i]);
|
||||
|
||||
assert(hashmap_isempty(m->units_requiring_mounts_for));
|
||||
hashmap_free(m->units_requiring_mounts_for);
|
||||
@ -2923,6 +2923,8 @@ int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit) {
|
||||
assert(m);
|
||||
|
||||
for (i = 0; i < _RLIMIT_MAX; i++) {
|
||||
m->rlimit[i] = mfree(m->rlimit[i]);
|
||||
|
||||
if (!default_rlimit[i])
|
||||
continue;
|
||||
|
||||
|
@ -119,6 +119,25 @@ setup_basic_environment() {
|
||||
generate_module_dependencies
|
||||
}
|
||||
|
||||
install_valgrind() {
|
||||
if ! type -p valgrind; then
|
||||
dfatal "Failed to install valgrind"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local _valgrind_bins=$(strace -e execve valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if /^execve\("([^"]+)"/')
|
||||
dracut_install $_valgrind_bins
|
||||
|
||||
local _valgrind_libs=$(LD_DEBUG=files valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if m{calling init: (/.*vgpreload_.*)}')
|
||||
dracut_install $_valgrind_libs
|
||||
|
||||
local _valgrind_dbg_and_supp=$(
|
||||
strace -e open valgrind /bin/true 2>&1 >/dev/null |
|
||||
perl -lne 'if (my ($fname) = /^open\("([^"]+).*= (?!-)\d+/) { print $fname if $fname =~ /debug|\.supp$/ }'
|
||||
)
|
||||
dracut_install $_valgrind_dbg_and_supp
|
||||
}
|
||||
|
||||
install_dmevent() {
|
||||
instmods dm_crypt =crypto
|
||||
type -P dmeventd >/dev/null && dracut_install dmeventd
|
||||
|
Loading…
x
Reference in New Issue
Block a user