[libvirt PATCH 3/3] ch: check return value of virJSONValueArrayAppend

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

 



It only errors out when presented with a non-array, but we do check
it everywhere else.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/ch/ch_monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 3e49902791..ccd04cfbd1 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -1002,7 +1002,8 @@ virCHMonitorBuildRestoreJson(virDomainDef *vmdef,
                 return -1;
             if (virJSONValueObjectAppendNumberInt(net_json, "num_fds", vmdef->nets[i]->driver.virtio.queues))
                 return -1;
-            virJSONValueArrayAppend(nets, &net_json);
+            if (virJSONValueArrayAppend(nets, &net_json) < 0)
+                return -1;
         }
         if (virJSONValueObjectAppend(restore_json, "net_fds", &nets))
             return -1;
-- 
2.47.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux