summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-01-14 10:35:45 +0100
committerDaniel Mack <github@zonque.org>2016-01-14 10:35:45 +0100
commitca9ec350f39096f19d6672e38ca2419877627a4b (patch)
treee230757906fdec8c68c93df4805b4f54e15a629c /src
parent8ec46f55e5d615696b013e6325b19af441fdd187 (diff)
parenta2fbff31c9c319da51528f85ae97d019f1e61a86 (diff)
Merge pull request #2320 from evverx/fix-memory-leak-on-reload
Fix memory leak on daemon-reload
Diffstat (limited to 'src')
-rw-r--r--src/core/manager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 711b0cdcee..39e3cbbfe1 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -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;