mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c
This commit is contained in:
parent
f48ba88b35
commit
528f420e03
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user