chiark / gitweb /
detect_virtualization() returns NULL; pass empty string to dbus
authorKay Sievers <kay@vrfy.org>
Fri, 1 Nov 2013 23:01:32 +0000 (00:01 +0100)
committerKay Sievers <kay@vrfy.org>
Fri, 1 Nov 2013 23:02:56 +0000 (00:02 +0100)
src/core/dbus-manager.c

index 46f55d0..b47fc85 100644 (file)
@@ -466,7 +466,7 @@ static int bus_manager_append_progress(DBusMessageIter *i, const char *property,
 
 static int bus_manager_append_virt(DBusMessageIter *i, const char *property, void *data) {
         Manager *m = data;
-        const char *id = "";
+        const char *id = NULL;
 
         assert(i);
         assert(property);
@@ -474,6 +474,8 @@ static int bus_manager_append_virt(DBusMessageIter *i, const char *property, voi
 
         detect_virtualization(&id);
 
+        if (!id)
+                id = "";
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &id))
                 return -ENOMEM;