[PATCH 14/13] Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c

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

 



---

In case we want virsh included to these changes.

 tools/virsh.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 6f0c1ef..26d37c6 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -122,9 +122,7 @@ _vshStrdup(vshControl *ctl, const char *s, const char *filename, int line)
 {
     char *x;
 
-    if (s == NULL)
-        return NULL;
-    if ((x = strdup(s)))
+    if (VIR_STRDUP(x, s) >= 0)
         return x;
     vshError(ctl, _("%s: %d: failed to allocate %lu bytes"),
              filename, line, (unsigned long)strlen(s));
-- 
1.8.2.1

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