Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
char *veth1auto = NULL;
char *veth2auto = NULL;
int vethNum = 0;
+ virCommandPtr cmd = NULL;
size_t i;
/*
vethNum = veth2num + 1;
}
- virCommandPtr cmd = virCommandNew("ip");
+ cmd = virCommandNew("ip");
virCommandAddArgList(cmd, "link", "add",
*veth1 ? *veth1 : veth1auto,
"type", "veth", "peer", "name",
status);
VIR_FREE(veth1auto);
VIR_FREE(veth2auto);
+ virCommandFree(cmd);
+ cmd = NULL;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
MAX_VETH_RETRIES);
cleanup:
+ virCommandFree(cmd);
VIR_FREE(veth1auto);
VIR_FREE(veth2auto);
return ret;