[PATCH 2/6] openvz: Check errors from virSocketAddrFormat

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

 



Commit id 'a4e86390' modified the command line to allow --ipadd multiple
times; however, it did not account for the condition where a NULL is
returned which will could lead to some interesting errors with multiple
--ipadd's without parameters.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/openvz/openvz_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 64f5219..17919be 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -910,6 +910,8 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
         /* --ipadd ip */
         for (i = 0; i < net->nips; i++) {
             char *ipStr = virSocketAddrFormat(&net->ips[i]->address);
+            if (!ipStr)
+                goto cleanup;
             virCommandAddArgList(cmd, "--ipadd", ipStr, NULL);
             VIR_FREE(ipStr);
         }
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]