From fea9740ae463c409b84a38d2592d434c2875975b Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Fri, 1 Mar 2013 18:29:58 +0100 Subject: systemctl: check if iterator was initialized succesfully --- src/systemctl/systemctl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/systemctl/systemctl.c') 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."); -- cgit v1.2.3-54-g00ecf