]> xenbits.xensource.com Git - libvirt.git/commitdiff
Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 23 May 2013 07:51:59 +0000 (09:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 24 May 2013 08:10:03 +0000 (10:10 +0200)
tools/virsh.c

index 6f0c1ef7dc1ff255b1ccfb7860e2f2d9a1685367..26d37c69ad808e821e34484421aab99108202c45 100644 (file)
@@ -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));