[PATCH v2 25/37] Adapt to VIR_STRDUP in src/uml/*

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

 



---
 src/uml/uml_conf.c   | 4 ++--
 src/uml/uml_driver.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index a55b5b1..47e0fc0 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -114,7 +114,7 @@ umlConnectTapDevice(virConnectPtr conn,
         STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) ||
         strchr(net->ifname, '%')) {
         VIR_FREE(net->ifname);
-        if (!(net->ifname = strdup(VIR_NET_GENERATED_PREFIX "%d")))
+        if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_PREFIX "%d") < 0)
             goto no_memory;
         /* avoid exposing vnet%d in getXMLDesc or error outputs */
         template_ifname = true;
@@ -463,7 +463,7 @@ virCommandPtr umlBuildCommandLine(virConnectPtr conn,
     if (vm->def->os.cmdline) {
         char *args, *next_arg;
         char *cmdline;
-        if ((cmdline = strdup(vm->def->os.cmdline)) == NULL)
+        if (VIR_STRDUP(cmdline, vm->def->os.cmdline) < 0)
             goto no_memory;
 
         args = cmdline;
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 66c00b2..709edf1 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -248,7 +248,7 @@ requery:
 
     if (res && STRPREFIX(res, "pts:")) {
         VIR_FREE(def->source.data.file.path);
-        if ((def->source.data.file.path = strdup(res + 4)) == NULL) {
+        if (VIR_STRDUP(def->source.data.file.path, res + 4) < 0) {
             virReportOOMError();
             VIR_FREE(res);
             VIR_FREE(cmd);
@@ -491,7 +491,7 @@ umlStateInitialize(bool privileged,
                         "%s/log/libvirt/uml", LOCALSTATEDIR) == -1)
             goto out_of_memory;
 
-        if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL)
+        if (VIR_STRDUP(base, SYSCONFDIR "/libvirt") < 0)
             goto out_of_memory;
 
         if (virAsprintf(&uml_driver->monitorDir,
@@ -1665,7 +1665,7 @@ static char *umlDomainGetOSType(virDomainPtr dom) {
         goto cleanup;
     }
 
-    if (!(type = strdup(vm->def->os.type)))
+    if (VIR_STRDUP(type, vm->def->os.type) < 0)
         virReportOOMError();
 
 cleanup:
-- 
1.8.1.5

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