提交 528f420e 编写于 作者: M Michal Privoznik

Adapt to VIR_STRDUP and VIR_STRNDUP in tools/virsh.c

上级 f48ba88b
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册