summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-01-11 01:26:24 +0800
committerMike Yuan <me@yhndnzj.com>2023-01-11 01:34:32 +0800
commitfd55b2e599564a9a97890697e7e40df5d2b4745e (patch)
tree7ead01a653977a178abd5183aca463ccf5b7ac40 /src/core
parent65a2493e3876f7a040c694e1004c5c765fd29c27 (diff)
downloadsystemd-fd55b2e599564a9a97890697e7e40df5d2b4745e.tar.gz
core/transaction: modernize to use cleanup attribute
Diffstat (limited to 'src/core')
-rw-r--r--src/core/transaction.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c
index fe8ba8d903..6beca0e6c4 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -976,11 +976,11 @@ int transaction_add_job_and_dependencies(
}
if (is_new && !ignore_requirements && type != JOB_NOP) {
- Set *following;
+ _cleanup_set_free_ Set *following = NULL;
/* If we are following some other unit, make sure we
* add all dependencies of everybody following. */
- if (unit_following_set(ret->unit, &following) > 0) {
+ if (unit_following_set(ret->unit, &following) > 0)
SET_FOREACH(dep, following) {
r = transaction_add_job_and_dependencies(tr, type, dep, ret, false, false, false, ignore_order, e);
if (r < 0) {
@@ -991,9 +991,6 @@ int transaction_add_job_and_dependencies(
}
}
- set_free(following);
- }
-
/* Finally, recursively add in all dependencies. */
if (IN_SET(type, JOB_START, JOB_RESTART)) {
UNIT_FOREACH_DEPENDENCY(dep, ret->unit, UNIT_ATOM_PULL_IN_START) {