9fc0f6
From 98ec954cba5abf87f29cf5122825eb565b5bdf64 Mon Sep 17 00:00:00 2001
9fc0f6
From: Kay Sievers <kay@vrfy.org>
9fc0f6
Date: Sat, 2 Nov 2013 00:01:32 +0100
9fc0f6
Subject: [PATCH] detect_virtualization() returns NULL; pass empty string to
9fc0f6
 dbus
9fc0f6
9fc0f6
---
9fc0f6
 src/core/dbus-manager.c | 4 +++-
9fc0f6
 1 file changed, 3 insertions(+), 1 deletion(-)
9fc0f6
9fc0f6
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
9fc0f6
index 7be5d13..6d16c2a 100644
9fc0f6
--- a/src/core/dbus-manager.c
9fc0f6
+++ b/src/core/dbus-manager.c
9fc0f6
@@ -466,7 +466,7 @@ static int bus_manager_append_progress(DBusMessageIter *i, const char *property,
9fc0f6
 
9fc0f6
 static int bus_manager_append_virt(DBusMessageIter *i, const char *property, void *data) {
9fc0f6
         Manager *m = data;
9fc0f6
-        const char *id = "";
9fc0f6
+        const char *id = NULL;
9fc0f6
 
9fc0f6
         assert(i);
9fc0f6
         assert(property);
9fc0f6
@@ -474,6 +474,8 @@ static int bus_manager_append_virt(DBusMessageIter *i, const char *property, voi
9fc0f6
 
9fc0f6
         detect_virtualization(&id;;
9fc0f6
 
9fc0f6
+        if (!id)
9fc0f6
+                id = "";
9fc0f6
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &id))
9fc0f6
                 return -ENOMEM;
9fc0f6