Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c

This commit is contained in:
Michal Privoznik 2013-05-23 09:51:59 +02:00
parent f48ba88b35
commit 528f420e03

View 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));