chiark / gitweb /
systemctl: check if iterator was initialized succesfully
authorLukas Nykryn <lnykryn@redhat.com>
Fri, 1 Mar 2013 17:29:58 +0000 (18:29 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 1 Mar 2013 21:43:57 +0000 (16:43 -0500)
src/systemctl/systemctl.c

index c67c6c9..99286cf 100644 (file)
@@ -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.");