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

* src/lxc/lxc_driver.c (lxcFreezeContainer): Remove test-after-deref.
Correct indentation in expression.
This commit is contained in:
Jim Meyering 2010-05-17 19:18:12 +02:00
parent 61fb697977
commit 93fedcf20f

View File

@ -2306,9 +2306,11 @@ static int lxcFreezeContainer(lxc_driver_t *driver, virDomainObjPtr vm)
virCgroupPtr cgroup = NULL;
if (!(driver->cgroup &&
virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) == 0))
virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) == 0))
return -1;
/* From here on, we know that cgroup != NULL. */
while (waited_time < timeout) {
int r;
/*
@ -2381,8 +2383,7 @@ error:
ret = -1;
cleanup:
if (cgroup)
virCgroupFree(&cgroup);
virCgroupFree(&cgroup);
VIR_FREE(state);
return ret;
}