mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user