[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 07/12] util: properly handle NULL props in virQEMUBuildObjectCommandlineFromJSON



Signed-off-by: Pavel Hrdina <phrdina redhat com>
---
 src/util/virqemu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/virqemu.c b/src/util/virqemu.c
index 2e9e65f9ef..712fd1ad4f 100644
--- a/src/util/virqemu.c
+++ b/src/util/virqemu.c
@@ -229,7 +229,8 @@ virQEMUBuildCommandLineJSON(virJSONValuePtr value,
                             virBufferPtr buf,
                             virQEMUBuildCommandLineJSONArrayFormatFunc array)
 {
-    if (virQEMUBuildCommandLineJSONRecurse(NULL, value, buf, array, false) < 0)
+    if (value &&
+        virQEMUBuildCommandLineJSONRecurse(NULL, value, buf, array, false) < 0)
         return -1;
 
     virBufferTrim(buf, ",", -1);
-- 
2.11.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]