summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-01-18 10:52:15 +0100
committerDaniel Mack <github@zonque.org>2016-01-18 10:52:15 +0100
commit0cdf4f210c70bdb8611c32c0150ee93cabd1e8b5 (patch)
tree2f387cdd13582bf4bcc7bc9a141b7d4b97985fae
parente1333db540c64bf8c3692c5330e661da0b4dcecc (diff)
parentc292c3af38c8c23e183f3e63ef492926cea64bab (diff)
Merge pull request #2350 from evverx/fix-memory-leak-on-failed-preset-all
core: fix memory leak on failed preset-all
-rw-r--r--src/core/dbus-manager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 23a16ac15e..c5c672a0a2 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1844,8 +1844,10 @@ static int method_preset_all_unit_files(sd_bus_message *message, void *userdata,
scope = m->running_as == MANAGER_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER;
r = unit_file_preset_all(scope, runtime, NULL, mm, force, &changes, &n_changes);
- if (r < 0)
+ if (r < 0) {
+ unit_file_changes_free(changes, n_changes);
return r;
+ }
return reply_unit_file_changes_and_free(m, message, -1, changes, n_changes);
}