提交 391b8272 编写于 作者: G Gao feng 提交者: Daniel P. Berrange

Free cmd in virNetDevVethCreate

Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
上级 524b2197
......@@ -110,6 +110,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
char *veth1auto = NULL;
char *veth2auto = NULL;
int vethNum = 0;
virCommandPtr cmd = NULL;
size_t i;
/*
......@@ -139,7 +140,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
vethNum = veth2num + 1;
}
virCommandPtr cmd = virCommandNew("ip");
cmd = virCommandNew("ip");
virCommandAddArgList(cmd, "link", "add",
*veth1 ? *veth1 : veth1auto,
"type", "veth", "peer", "name",
......@@ -169,6 +170,8 @@ int virNetDevVethCreate(char** veth1, char** veth2)
status);
VIR_FREE(veth1auto);
VIR_FREE(veth2auto);
virCommandFree(cmd);
cmd = NULL;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
......@@ -176,6 +179,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
MAX_VETH_RETRIES);
cleanup:
virCommandFree(cmd);
VIR_FREE(veth1auto);
VIR_FREE(veth2auto);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册