提交 a267f015 编写于 作者: J John Ferlan

openvz: Check errors from virSocketAddrFormat

Commit id 'a4e86390' modified the command line to allow --ipadd multiple
times; however, it did not account for the condition where a NULL is
returned which will could lead to some interesting errors with multiple
--ipadd's without parameters.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 21160a7a
......@@ -910,6 +910,8 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
/* --ipadd ip */
for (i = 0; i < net->nips; i++) {
char *ipStr = virSocketAddrFormat(&net->ips[i]->address);
if (!ipStr)
goto cleanup;
virCommandAddArgList(cmd, "--ipadd", ipStr, NULL);
VIR_FREE(ipStr);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册