summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-31 23:51:12 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-31 23:51:12 +0200
commit60dc72b563cdd4166cc6cb4e3c790bdfe1570ad2 (patch)
treecfb3ff2ae4cb5b0f5e3b0b001e6354ca24c26ea0 /src/manager.c
parentca949c9dcf17ea8d6512ac4c5c1a806ded9b8dc1 (diff)
manager: make sure we free the dbus error only if we actually use one
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/manager.c b/src/manager.c
index c22aa3ecee..bc589bacc7 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -1432,13 +1432,17 @@ static int transaction_add_job_and_dependencies(
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUIRES_OVERRIDABLE], i)
if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, !override, override, false, e, NULL)) < 0 && r != -EBADR) {
log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
- dbus_error_free(e);
+
+ if (e)
+ dbus_error_free(e);
}
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_WANTS], i)
if ((r = transaction_add_job_and_dependencies(m, JOB_START, dep, ret, false, false, false, e, NULL)) < 0) {
log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
- dbus_error_free(e);
+
+ if (e)
+ dbus_error_free(e);
}
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUISITE], i)
@@ -1448,7 +1452,9 @@ static int transaction_add_job_and_dependencies(
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUISITE_OVERRIDABLE], i)
if ((r = transaction_add_job_and_dependencies(m, JOB_VERIFY_ACTIVE, dep, ret, !override, override, false, e, NULL)) < 0 && r != -EBADR) {
log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
- dbus_error_free(e);
+
+ if (e)
+ dbus_error_free(e);
}
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_CONFLICTS], i)