summaryrefslogtreecommitdiff
path: root/src/dbus-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-21 05:00:29 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-21 05:00:29 +0200
commita7f241db3f1ae96ab2708092e1b31d2feb989947 (patch)
treed48588845b8d22658eb7a46bee49d58ec528716d /src/dbus-manager.c
parent672c48cc065251ddbdc3926221e8a7718241cccd (diff)
unit: deduce following unit value dynamically instead of statically, to avoid dangling pointers
Diffstat (limited to 'src/dbus-manager.c')
-rw-r--r--src/dbus-manager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dbus-manager.c b/src/dbus-manager.c
index 63e8083805..c1238f0066 100644
--- a/src/dbus-manager.c
+++ b/src/dbus-manager.c
@@ -413,6 +413,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
const char *description, *load_state, *active_state, *sub_state, *sjob_type, *following;
DBusMessageIter sub2;
uint32_t job_id;
+ Unit *f;
if (k != u->meta.id)
continue;
@@ -424,7 +425,9 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
load_state = unit_load_state_to_string(u->meta.load_state);
active_state = unit_active_state_to_string(unit_active_state(u));
sub_state = unit_sub_state_to_string(u);
- following = u->meta.following ? u->meta.following->meta.id : "";
+
+ f = unit_following(u);
+ following = f ? f->meta.id : "";
if (!(u_path = unit_dbus_path(u)))
goto oom;