提交 537768a7 编写于 作者: J Jiri Denemark

conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 32e84d03
......@@ -242,25 +242,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
virDomainCapsCPUUsable usable,
char **blockers)
{
char *nameCopy = NULL;
char **blockersCopy = NULL;
g_autofree char * nameCopy = NULL;
VIR_AUTOSTRINGLIST blockersCopy = NULL;
if (VIR_STRNDUP(nameCopy, name, nameLen) < 0)
goto error;
return -1;
if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0)
goto error;
return -1;
if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy,
usable, &blockersCopy) < 0)
goto error;
return -1;
return 0;
error:
VIR_FREE(nameCopy);
virStringListFree(blockersCopy);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册