From: Michal Privoznik Date: Thu, 23 May 2013 07:51:59 +0000 (+0200) Subject: Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c X-Git-Tag: v1.0.6-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=528f420e036ffbb31c6b8418499832378693eac6;p=thirdparty%2Flibvirt.git Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c --- diff --git a/tools/virsh.c b/tools/virsh.c index 6f0c1ef7dc..26d37c69ad 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));