mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
lxc: Don't mangle @cfg refs in virLXCProcessBuildControllerCmd
The config object is refed but unrefed only on error which leaves refcount unbalanced on successful return. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
696a9faa8e
commit
e6d3e46bb5
@ -931,7 +931,7 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
|
|||||||
filterstr = virLogGetFilters();
|
filterstr = virLogGetFilters();
|
||||||
if (!filterstr) {
|
if (!filterstr) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto cleanup;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_FILTERS", filterstr);
|
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_FILTERS", filterstr);
|
||||||
@ -943,7 +943,7 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
|
|||||||
outputstr = virLogGetOutputs();
|
outputstr = virLogGetOutputs();
|
||||||
if (!outputstr) {
|
if (!outputstr) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto cleanup;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_OUTPUTS", outputstr);
|
virCommandAddEnvPair(cmd, "LIBVIRT_LOG_OUTPUTS", outputstr);
|
||||||
@ -973,7 +973,7 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
|
|||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
if (virAsprintf(&tmp, "--share-%s",
|
if (virAsprintf(&tmp, "--share-%s",
|
||||||
nsInfoLocal[i]) < 0)
|
nsInfoLocal[i]) < 0)
|
||||||
goto cleanup;
|
goto error;
|
||||||
virCommandAddArg(cmd, tmp);
|
virCommandAddArg(cmd, tmp);
|
||||||
virCommandAddArgFormat(cmd, "%d", nsInheritFDs[i]);
|
virCommandAddArgFormat(cmd, "%d", nsInheritFDs[i]);
|
||||||
virCommandPassFD(cmd, nsInheritFDs[i], 0);
|
virCommandPassFD(cmd, nsInheritFDs[i], 0);
|
||||||
@ -999,11 +999,13 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
|
|||||||
* write the live domain status XML with the PID */
|
* write the live domain status XML with the PID */
|
||||||
virCommandRequireHandshake(cmd);
|
virCommandRequireHandshake(cmd);
|
||||||
|
|
||||||
return cmd;
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virCommandFree(cmd);
|
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
return NULL;
|
return cmd;
|
||||||
|
error:
|
||||||
|
virCommandFree(cmd);
|
||||||
|
cmd = NULL;
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user