You need to sign in or sign up before continuing.
提交 9a99b01f 编写于 作者: P Pavel Hrdina

vircgroupv2: fix abort in VIR_AUTOFREE

Introduced by commit <c854e0bd> that
tried to fix an issue where we would fail to parse values from files.

We cannot change the original pointer that is going to be used by
VIR_AUTOFREE.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1747440Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
Acked-by: NPeter Krempa <pkrempa@redhat.com>
上级 77725439
......@@ -849,6 +849,7 @@ virCgroupV2GetBlkioDeviceWeight(virCgroupPtr group,
VIR_AUTOFREE(char *) path = NULL;
VIR_AUTOFREE(char *) str = NULL;
VIR_AUTOFREE(char *) value = NULL;
char *tmp;
if (virCgroupV2PathOfController(group, VIR_CGROUP_CONTROLLER_BLKIO,
"io.weight", &path) < 0) {
......@@ -869,7 +870,7 @@ virCgroupV2GetBlkioDeviceWeight(virCgroupPtr group,
if (!str) {
*weight = 0;
} else if (virStrToLong_ui(str, &str, 10, weight) < 0) {
} else if (virStrToLong_ui(str, &tmp, 10, weight) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse '%s' as an integer"),
str);
......@@ -1576,6 +1577,7 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group,
long long *cfs_quota)
{
VIR_AUTOFREE(char *) str = NULL;
char *tmp;
if (virCgroupGetValueStr(group, VIR_CGROUP_CONTROLLER_CPU,
"cpu.max", &str) < 0) {
......@@ -1587,7 +1589,7 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group,
return 0;
}
if (virStrToLong_ll(str, &str, 10, cfs_quota) < 0) {
if (virStrToLong_ll(str, &tmp, 10, cfs_quota) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse value '%s' from cpu.max."), str);
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册