提交 93fedcf2 编写于 作者: J Jim Meyering

lxcFreezeContainer: avoid test-after-deref of never-NULL pointer

* src/lxc/lxc_driver.c (lxcFreezeContainer): Remove test-after-deref.
Correct indentation in expression.
上级 61fb6979
...@@ -2306,9 +2306,11 @@ static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm) ...@@ -2306,9 +2306,11 @@ static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
virCgroupPtr cgroup = NULL; virCgroupPtr cgroup = NULL;
if (!(driver->cgroup && if (!(driver->cgroup &&
virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) == 0)) virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) == 0))
return -1; return -1;
/* From here on, we know that cgroup != NULL. */
while (waited_time < timeout) { while (waited_time < timeout) {
int r; int r;
/* /*
...@@ -2381,8 +2383,7 @@ error: ...@@ -2381,8 +2383,7 @@ error:
ret = -1; ret = -1;
cleanup: cleanup:
if (cgroup) virCgroupFree(&cgroup);
virCgroupFree(&cgroup);
VIR_FREE(state); VIR_FREE(state);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册