summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-03-01 18:29:58 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-01 16:43:57 -0500
commitfea9740ae463c409b84a38d2592d434c2875975b (patch)
treea58d8d519278ad2b77bce38aa44e1caf74c38ca1 /src
parent34bf02818d06343982a06a1c33d165190e918d0d (diff)
systemctl: check if iterator was initialized succesfully
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index c67c6c972a..99286cfc75 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -2084,7 +2084,11 @@ static int get_cgroup_attr(DBusConnection *bus, char **args) {
if (r < 0)
return r;
- dbus_message_iter_init(reply, &iter);
+ if (!dbus_message_iter_init(reply, &iter)) {
+ log_error("Failed to initialize iterator.");
+ return -EIO;
+ }
+
r = bus_parse_strv_iter(&iter, &list);
if (r < 0) {
log_error("Failed to parse value list.");